diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index a092c237e8..2e2f1ca260 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -1,47 +1,122 @@ name: PR Build on: - pull_request: - paths: - - ".github/workflows/pr-build.yml" - - "android/**" - - "assets/**" - - "lib/**" - + workflow_dispatch: + inputs: + # Flutter + flutter-branch: + description: Flutter branch + type: choice + default: 'stable' + options: + - stable + - beta + - dev + - master + flutter-cache: + description: Cache + type: boolean + default: true + # Application configuration + app-flavour: + description: App flavour + default: 'release' + type: choice + options: + - release + - debug + - profile + # Pull Request + pr-number: + description: PR number (No hashtag) + required: true + +run-name: "Build PR ${{ inputs.pr-number }}" + jobs: build: - name: Build + name: Build the application runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: + - name: Setup + env: + GH_TOKEN: ${{ github.token }} + run: | + gh repo clone ${{ github.repository }} + cd revanced-manager + gh repo set-default ${{ github.repository }} + gh pr checkout ${{ inputs.pr-number }} + + echo "DATETIME=$( TZ='UTC+0' date --rfc-email )" >> $GITHUB_ENV + echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: Checkout uses: actions/checkout@v4 with: - # Make sure the release step uses its own credentials: - # https://github.com/cycjimmy/semantic-release-action#private-packages persist-credentials: false - fetch-depth: 0 + - name: Setup JDK uses: actions/setup-java@v3 with: java-version: '17' distribution: 'zulu' + cache: gradle + - name: Setup Flutter uses: subosito/flutter-action@v2 with: - channel: 'stable' - cache: true + channel: ${{ inputs.flutter-branch }} + cache: ${{ inputs.flutter-cache }} + - name: Install Flutter dependencies run: flutter pub get - name: Generate translation with Slang run: dart run slang - name: Generate files with Builder - run: flutter packages pub run build_runner build --delete-conflicting-outputs + run: dart run build_runner build --delete-conflicting-outputs + - name: Build with Flutter - env: + continue-on-error: true + id: flutter-build + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: flutter build apk --debug + run: | + flutter build apk --${{ inputs.app-flavour }}; + + - name: Prepare to comment + run: | + if [[ "${{ steps.flutter-build.outcome }}" == "success" ]]; then + echo "MESSAGE=✅ ReVanced Manager ${{ env.COMMIT_HASH }} build succeeded." >> $GITHUB_ENV + else + echo "MESSAGE=🚫 ReVanced Manager ${{ env.COMMIT_HASH }} build failed." >> $GITHUB_ENV + fi + + - name: "Comment to Pull Request #${{ inputs.pr-number }}" + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ github.token }} + pr_number: ${{ inputs.pr-number }} + mode: recreate + message: | + ## ⚒️ ReVanced PR Build workflow + + ${{ env.MESSAGE }} + + You can see more details in run [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})! + + ### ⚙️ Overview + - App flavor: ${{ inputs.app-flavour }} + - Branch: ${{ inputs.flutter-branch }} + - Start time: ${{ env.DATETIME }} + - name: Upload build uses: actions/upload-artifact@v3 with: - name: revanced-manager - path: build/app/outputs/flutter-apk/app-debug.apk + if-no-files-found: error + name: revanced-manager-(${{ env.COMMIT_HASH }}-${{ inputs.pr-number }}-${{ inputs.app-flavour }})-${{ inputs.flutter-branch }} + path: | + build/app/outputs/flutter-apk/app-${{ inputs.app-flavour }}.apk + build/app/outputs/flutter-apk/app-${{ inputs.app-flavour }}.apk.sha1 diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 309be8ac73..c1ae159c10 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -25,7 +25,7 @@ jobs: - name: Generate translation with Slang run: dart run slang - name: Generate files with Builder - run: flutter packages pub run build_runner build --delete-conflicting-outputs + run: dart run build_runner build --delete-conflicting-outputs - name: Build with Flutter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..d261a86a03 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,88 @@ +

+ + + + +
+ + +     + + + + + +     + + +     + + +     + + +     + + + + + +     + + + +
+
+ Continuing the legacy of Vanced +

+ +# 👋 Contribution guidelines + +This document describes how to contribute to ReVanced Manager. + +## 📖 Resources to help you get started + +* The [documentation](/docs/README.md) provides steps to build ReVanced Manager from source +* Our [backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on +* [Issues](https://github.com/ReVanced/revanced-manager/issues) are where we keep track of bugs and feature requests + +## 🙏 Submitting a feature request + +Features can be requested by opening an issue using the +[feature request issue template](https://github.com/ReVanced/revanced-manager/issues/new?assignees=&labels=feature-request&projects=&template=feature-issue.yml&title=feat%3A+%3Ctitle%3E). + +> [!NOTE] +> We may reject your request at the discretion of ReVanced Manager's maintainers, +> please provide good motivation for a request to be accepted. + +## 🐞 Submitting a bug report + +If you encounter a bug while using the ReVanced Manager app, open an issue using the +[bug report issue template](https://github.com/ReVanced/revanced-manager/issues/new?assignees=&labels=bug&projects=&template=bug-issue.yml&title=bug%3A+%3Ctitle%3E). + +## 📝 How to contribute + +> [!NOTE] +> We recommend that you discuss your changes with +> the maintainers of ReVanced Manager before contributing. +> This will help you determine whether your change is acceptable. + +1. Fork the repository and create a new branch based off the `dev` branch +2. Commit your changes +3. Open a pull request to the `dev` branch and reference issues that your pull request closes +4. The maintainers of ReVanced Manager will review and provide suggestions. + Once your pull request is approved and merged, it will be included in the next release of ReVanced Manager + +## 🤚 I want to contribute but don't know how to code + +Even if you don't know how to code, you can still contribute by +translating ReVanced Manager on [Crowdin](https://translate.revanced.app/). + +❤️ Thank you for considering contributing to ReVanced Manager. diff --git a/README.md b/README.md index 89f41ea69e..6db2ff9bf1 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,97 @@ +

+ + + + +
+ + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + + +
+
+ Continuing the legacy of Vanced +

+ # 💊 ReVanced Manager -The official ReVanced Manager based on Flutter. +[![GitHub last commit](https://img.shields.io/github/last-commit/ReVanced/revanced-manager)](https://github.com/ReVanced/revanced-manager/commits "") +[![GitHub commit activity](https://img.shields.io/github/commit-activity/w/ReVanced/revanced-manager)](https://github.com/ReVanced/revanced-manager/commits "") -## 🔽 Download +ReVanced Manager is an Android application that uses ReVanced Patcher to add, remove, and modify existing functionalities in Android applications. + +## 💪 Features -You can obtain ReVanced Manager by downloading it from either [revanced.app/download](https://revanced.app/download) or [GitHub Releases](https://github.com/ReVanced/revanced-manager/releases) +We provide the some of the features are: + +* 📱 **Portable**: ReVanced Patcher that fit in your pocket; +* 🤗 **Intuitive UI**: Help you manage your patched applications with easy-to-use interface; +* 🛠️ **Customization**: Patch with third-party sources; +* ✨ And a **lot more!** + +## 🔽 Download -## 📝 Prerequisites +You can get ReVanced Manager by downloading from [ReVanced site](https://revanced.app/download) or [GitHub releases](https://github.com/ReVanced/revanced-manager/releases). -1. Android 8 or higher -2. Incompatible with certain ARMv7 devices +## 📚 Everything else -## 📃 Documentation -The documentation can be found [here](https://github.com/revanced/revanced-manager/tree/main/docs). +### 📄 Documentation -## 🔴 Issues +Documentation on how to use the application is available [here](/docs/README.md). -For suggestions and bug reports, open an issue [here](https://github.com/revanced/revanced-manager/issues/new/choose). +### 👋 Contributing -## 🌐 Translation +Thank you for considering contributing to ReVanced Manager, you can find the contribution guidelines [here](/CONTRIBUTING.md). -[![Crowdin](https://badges.crowdin.net/revanced/localized.svg)](https://crowdin.com/project/revanced) +### 🔴 Issues -We're accepting translations on [Crowdin](https://translate.revanced.app). +For suggestions and bug reports, open an issue [here](https://github.com/ReVanced/revanced-manager/issues/choose). -## 🛠️ Building Manager from source +## ⚖️ License -1. Setup flutter environment for your [platform](https://docs.flutter.dev/get-started/install) -2. Clone the repository locally -3. Add your GitHub token in gradle.properties like [this](/docs/4_building.md) -4. Open the project in terminal -5. Run `flutter pub get` in terminal -6. Then `flutter packages pub run build_runner build --delete-conflicting-outputs` (Must be done on each git pull) -7. To build release APK run `flutter build apk` +ReVanced Manager adopts the [GNU General Public License 3.0](/LICENSE), [tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3): You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions. diff --git a/android/app/build.gradle b/android/app/build.gradle index 3140585aa3..0b83c0af7e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -63,6 +63,16 @@ android { abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64' } } + profile { + shrinkResources false + minifyEnabled false + resValue "string", "app_name", "ReVanced Manager Profile" + applicationIdSuffix ".profile" + signingConfig signingConfigs.debug + ndk { + abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64' + } + } } packagingOptions { jniLibs { diff --git a/assets/revanced-headline/revanced-headline-vertical-dark.svg b/assets/revanced-headline/revanced-headline-vertical-dark.svg new file mode 100644 index 0000000000..a59bfb50bf --- /dev/null +++ b/assets/revanced-headline/revanced-headline-vertical-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/revanced-headline/revanced-headline-vertical-light.svg b/assets/revanced-headline/revanced-headline-vertical-light.svg new file mode 100644 index 0000000000..3c5eeccc70 --- /dev/null +++ b/assets/revanced-headline/revanced-headline-vertical-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/revanced-logo/revanced-logo-round.svg b/assets/revanced-logo/revanced-logo-round.svg new file mode 100644 index 0000000000..901e1914b4 --- /dev/null +++ b/assets/revanced-logo/revanced-logo-round.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/4_building.md b/docs/4_building.md index f7861c408b..e4b89f7856 100644 --- a/docs/4_building.md +++ b/docs/4_building.md @@ -25,7 +25,7 @@ This page will guide you through building ReVanced Manager from source. 5. Delete conflicting outputs ```sh - flutter packages pub run build_runner build --delete-conflicting-outputs + dart run build_runner build --delete-conflicting-outputs ``` > [!Note] diff --git a/lib/main.dart b/lib/main.dart index 6b8a661635..0fef6a8138 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -32,7 +32,7 @@ Future main() async { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/services/manager_api.dart b/lib/services/manager_api.dart index e15e3d9d5b..74bb3413fd 100644 --- a/lib/services/manager_api.dart +++ b/lib/services/manager_api.dart @@ -591,8 +591,8 @@ class ManagerAPI { return showDialog( barrierDismissible: false, context: context, - builder: (context) => WillPopScope( - onWillPop: () async => false, + builder: (context) => PopScope( + canPop: false, child: AlertDialog( backgroundColor: Theme.of(context).colorScheme.secondaryContainer, title: Text(t.warning), diff --git a/lib/theme.dart b/lib/theme.dart index 89c93d520b..99883b4a39 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; var lightCustomColorScheme = ColorScheme.fromSeed( - seedColor: Colors.blue, - primary: const Color(0xff1B73E8), + seedColor: Colors.purple, + primary: const Color(0xFF4C51C0), ); var lightCustomTheme = ThemeData( @@ -21,10 +21,10 @@ var lightCustomTheme = ThemeData( ); var darkCustomColorScheme = ColorScheme.fromSeed( - seedColor: Colors.blue, + seedColor: Colors.purple, brightness: Brightness.dark, - primary: const Color(0xffA5CAFF), - surface: const Color(0xff1B1A1D), + primary: const Color(0xFFBFC1FF), + surface: const Color(0xFF131316), ); var darkCustomTheme = ThemeData( @@ -38,7 +38,7 @@ var darkCustomTheme = ThemeData( ), ), ), - canvasColor: const Color(0xff1B1A1D), - scaffoldBackgroundColor: const Color(0xff1B1A1D), + canvasColor: const Color(0xFF131316), + scaffoldBackgroundColor: const Color(0xFF131316), textTheme: GoogleFonts.robotoTextTheme(ThemeData.dark().textTheme), ); diff --git a/lib/ui/theme/dynamic_theme_builder.dart b/lib/ui/theme/dynamic_theme_builder.dart index c6a9f00fba..17e9aca65a 100644 --- a/lib/ui/theme/dynamic_theme_builder.dart +++ b/lib/ui/theme/dynamic_theme_builder.dart @@ -14,11 +14,11 @@ import 'package:stacked_services/stacked_services.dart'; class DynamicThemeBuilder extends StatefulWidget { const DynamicThemeBuilder({ - Key? key, + super.key, required this.title, required this.home, required this.localizationsDelegates, - }) : super(key: key); + }); final String title; final Widget home; diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index a5712d6e19..b2aee6cdc5 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -8,7 +8,7 @@ import 'package:revanced_manager/ui/widgets/shared/search_bar.dart'; import 'package:stacked/stacked.dart' hide SkeletonLoader; class AppSelectorView extends StatefulWidget { - const AppSelectorView({Key? key}) : super(key: key); + const AppSelectorView({super.key}); @override State createState() => _AppSelectorViewState(); @@ -107,7 +107,7 @@ class _AppSelectorViewState extends State { ), ), ) - .toList(), + , ...model .getFilteredAppsNames(_query) .map( @@ -121,7 +121,7 @@ class _AppSelectorViewState extends State { }, ), ) - .toList(), + , const SizedBox(height: 70.0), ], ), diff --git a/lib/ui/views/contributors/contributors_view.dart b/lib/ui/views/contributors/contributors_view.dart index 8d3dc7a957..33740a7b13 100644 --- a/lib/ui/views/contributors/contributors_view.dart +++ b/lib/ui/views/contributors/contributors_view.dart @@ -7,7 +7,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class ContributorsView extends StatelessWidget { - const ContributorsView({Key? key}) : super(key: key); + const ContributorsView({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index 3a803e9fa0..c5deea5e3e 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -9,7 +9,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class HomeView extends StatelessWidget { - const HomeView({Key? key}) : super(key: key); + const HomeView({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index fd23e6b1f0..21835d9a13 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -8,14 +8,15 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class InstallerView extends StatelessWidget { - const InstallerView({Key? key}) : super(key: key); + const InstallerView({super.key}); @override Widget build(BuildContext context) { return ViewModelBuilder.reactive( onViewModelReady: (model) => model.initialize(context), viewModelBuilder: () => InstallerViewModel(), - builder: (context, model, child) => WillPopScope( + builder: (context, model, child) => PopScope( + onPopInvoked: (bool didPop) => model.onPopInvoked(context, didPop), child: SafeArea( top: false, bottom: model.isPatching, @@ -77,7 +78,7 @@ class InstallerView extends StatelessWidget { maxLines: 1, overflow: TextOverflow.ellipsis, ), - onBackButtonPressed: () => model.onWillPop(context), + onBackButtonPressed: () => model.onBackButtonInvoked(context), bottom: PreferredSize( preferredSize: const Size(double.infinity, 1.0), child: GradientProgressIndicator(progress: model.progress), @@ -105,7 +106,6 @@ class InstallerView extends StatelessWidget { ), ), ), - onWillPop: () => model.onWillPop(context), ), ); } diff --git a/lib/ui/views/installer/installer_viewmodel.dart b/lib/ui/views/installer/installer_viewmodel.dart index 1e84acd647..580ef202c6 100644 --- a/lib/ui/views/installer/installer_viewmodel.dart +++ b/lib/ui/views/installer/installer_viewmodel.dart @@ -176,7 +176,8 @@ class InstallerViewModel extends BaseViewModel { Future copyLogs() async { final info = await AboutInfo.getInfo(); dynamic getValue(String patchName, Option option) { - final Option? savedOption = _managerAPI.getPatchOption(_app.packageName, patchName, option.key); + final Option? savedOption = + _managerAPI.getPatchOption(_app.packageName, patchName, option.key); if (savedOption != null) { return savedOption.value; } else { @@ -196,7 +197,6 @@ class InstallerViewModel extends BaseViewModel { 'App: ${_app.packageName} v${_app.version}', 'Patches version: ${_managerAPI.patchesVersion}', 'Patches: ${_patches.map((p) => p.name + (p.options.isEmpty ? '' : ' [${p.options.map((o) => '${o.title}: ${getValue(p.name, o)}').join(", ")}]')).toList().join(", ")}', - '\n- Settings', 'Allow changing patch selection: ${_managerAPI.isPatchesChangeEnabled()}', 'Version compatibility check: ${_managerAPI.isVersionCompatibilityCheckEnabled()}', @@ -416,25 +416,38 @@ class InstallerViewModel extends BaseViewModel { } } - Future onWillPop(BuildContext context) async { - if (isPatching) { + bool canPop() { + return !isPatching; + } + + void onBackButtonInvoked(BuildContext context) { + if (canPop()) { + onPopInvoked(context, true); + } else { + onPopInvoked(context, false); + } + } + + Future onPopInvoked(BuildContext context, bool didPop) async { + if (didPop) { if (!cancel) { - cancel = true; - _toast.showBottom(t.installerView.pressBackAgain); - } else if (!isCanceled) { - await stopPatcher(); + cleanPatcher(); } else { - _toast.showBottom(t.installerView.noExit); + _patcherAPI.cleanPatcher(); } - return false; - } - if (!cancel) { - cleanPatcher(); + screenshotCallback.dispose(); + Navigator.of(context).pop(); } else { - _patcherAPI.cleanPatcher(); + if (isPatching) { + if (!cancel) { + cancel = true; + _toast.showBottom(t.installerView.pressBackAgain); + } else if (!isCanceled) { + await stopPatcher(); + } else { + _toast.showBottom(t.installerView.noExit); + } + } } - screenshotCallback.dispose(); - Navigator.of(context).pop(); - return true; } } diff --git a/lib/ui/views/navigation/navigation_view.dart b/lib/ui/views/navigation/navigation_view.dart index 0c30476618..44cb267838 100644 --- a/lib/ui/views/navigation/navigation_view.dart +++ b/lib/ui/views/navigation/navigation_view.dart @@ -6,20 +6,18 @@ import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart'; import 'package:stacked/stacked.dart'; class NavigationView extends StatelessWidget { - const NavigationView({Key? key}) : super(key: key); + const NavigationView({super.key}); @override Widget build(BuildContext context) { return ViewModelBuilder.reactive( onViewModelReady: (model) => model.initialize(context), viewModelBuilder: () => locator(), - builder: (context, model, child) => WillPopScope( - onWillPop: () async { - if (model.currentIndex == 0) { - return true; - } else { + builder: (context, model, child) => PopScope( + canPop: model.currentIndex == 0, + onPopInvoked: (bool didPop) { + if (!didPop) { model.setIndex(0); - return false; } }, child: Scaffold( diff --git a/lib/ui/views/patch_options/patch_options_viewmodel.dart b/lib/ui/views/patch_options/patch_options_viewmodel.dart index df27389d6b..6a35891eaa 100644 --- a/lib/ui/views/patch_options/patch_options_viewmodel.dart +++ b/lib/ui/views/patch_options/patch_options_viewmodel.dart @@ -38,11 +38,11 @@ class PatchOptionsViewModel extends BaseViewModel { option.required && !savedOptions.any((sOption) => sOption.key == option.key), ) - .toList(), + , ]; } else { visibleOptions = [ - ...options.where((option) => option.required).toList(), + ...options.where((option) => option.required), ]; } } diff --git a/lib/ui/views/patcher/patcher_view.dart b/lib/ui/views/patcher/patcher_view.dart index 5faaab6db6..9c678dc0c5 100644 --- a/lib/ui/views/patcher/patcher_view.dart +++ b/lib/ui/views/patcher/patcher_view.dart @@ -9,7 +9,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class PatcherView extends StatelessWidget { - const PatcherView({Key? key}) : super(key: key); + const PatcherView({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index 36ba5d226f..cd04bf8e91 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -7,7 +7,7 @@ import 'package:revanced_manager/ui/widgets/shared/search_bar.dart'; import 'package:stacked/stacked.dart'; class PatchesSelectorView extends StatefulWidget { - const PatchesSelectorView({Key? key}) : super(key: key); + const PatchesSelectorView({super.key}); @override State createState() => _PatchesSelectorViewState(); diff --git a/lib/ui/views/settings/settings_view.dart b/lib/ui/views/settings/settings_view.dart index c9b7492be5..9ae5df625a 100644 --- a/lib/ui/views/settings/settings_view.dart +++ b/lib/ui/views/settings/settings_view.dart @@ -14,7 +14,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; class SettingsView extends StatelessWidget { - const SettingsView({Key? key}) : super(key: key); + const SettingsView({super.key}); static const _settingsDivider = Divider(thickness: 1.0, indent: 20.0, endIndent: 20.0); diff --git a/lib/ui/views/settings/settings_viewmodel.dart b/lib/ui/views/settings/settings_viewmodel.dart index 22ac88e74e..61f9b32931 100644 --- a/lib/ui/views/settings/settings_viewmodel.dart +++ b/lib/ui/views/settings/settings_viewmodel.dart @@ -140,7 +140,7 @@ class SettingsViewModel extends BaseViewModel { } Future? showRequireSuggestedAppVersionDialog( - BuildContext context, bool value) { + BuildContext context, bool value,) { if (!value) { return showDialog( context: context, diff --git a/lib/ui/widgets/appInfoView/app_info_view.dart b/lib/ui/widgets/appInfoView/app_info_view.dart index 601c1887ee..d655f550b3 100644 --- a/lib/ui/widgets/appInfoView/app_info_view.dart +++ b/lib/ui/widgets/appInfoView/app_info_view.dart @@ -9,9 +9,9 @@ import 'package:stacked/stacked.dart'; class AppInfoView extends StatelessWidget { const AppInfoView({ - Key? key, + super.key, required this.app, - }) : super(key: key); + }); final PatchedApplication app; @override diff --git a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart index 0cb80428a6..2f98d2a8b0 100644 --- a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart +++ b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart @@ -3,7 +3,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; import 'package:skeletons/skeletons.dart'; class AppSkeletonLoader extends StatelessWidget { - const AppSkeletonLoader({Key? key}) : super(key: key); + const AppSkeletonLoader({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/ui/widgets/appSelectorView/installed_app_item.dart b/lib/ui/widgets/appSelectorView/installed_app_item.dart index 220abe8b17..6cac4190be 100644 --- a/lib/ui/widgets/appSelectorView/installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/installed_app_item.dart @@ -5,7 +5,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; class InstalledAppItem extends StatefulWidget { const InstalledAppItem({ - Key? key, + super.key, required this.name, required this.pkgName, required this.icon, @@ -13,7 +13,7 @@ class InstalledAppItem extends StatefulWidget { required this.suggestedVersion, required this.installedVersion, this.onTap, - }) : super(key: key); + }); final String name; final String pkgName; final Uint8List icon; diff --git a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart index e16439bfab..143e4048b8 100644 --- a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart @@ -4,12 +4,12 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; class NotInstalledAppItem extends StatefulWidget { const NotInstalledAppItem({ - Key? key, + super.key, required this.name, required this.patchesCount, required this.suggestedVersion, this.onTap, - }) : super(key: key); + }); final String name; final int patchesCount; final String suggestedVersion; diff --git a/lib/ui/widgets/contributorsView/contributors_card.dart b/lib/ui/widgets/contributorsView/contributors_card.dart index 8d685fb13d..d5827ca096 100644 --- a/lib/ui/widgets/contributorsView/contributors_card.dart +++ b/lib/ui/widgets/contributorsView/contributors_card.dart @@ -6,10 +6,10 @@ import 'package:url_launcher/url_launcher.dart'; class ContributorsCard extends StatefulWidget { const ContributorsCard({ - Key? key, + super.key, required this.title, required this.contributors, - }) : super(key: key); + }); final String title; final List contributors; diff --git a/lib/ui/widgets/homeView/installed_apps_card.dart b/lib/ui/widgets/homeView/installed_apps_card.dart index 342090843a..8de0fae9ba 100644 --- a/lib/ui/widgets/homeView/installed_apps_card.dart +++ b/lib/ui/widgets/homeView/installed_apps_card.dart @@ -10,7 +10,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; //ignore: must_be_immutable class InstalledAppsCard extends StatelessWidget { - InstalledAppsCard({Key? key}) : super(key: key); + InstalledAppsCard({super.key}); List apps = locator().patchedInstalledApps; final ManagerAPI _managerAPI = locator(); diff --git a/lib/ui/widgets/homeView/latest_commit_card.dart b/lib/ui/widgets/homeView/latest_commit_card.dart index ccb33d1db9..464f08d9ef 100644 --- a/lib/ui/widgets/homeView/latest_commit_card.dart +++ b/lib/ui/widgets/homeView/latest_commit_card.dart @@ -7,10 +7,10 @@ import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart'; class LatestCommitCard extends StatefulWidget { const LatestCommitCard({ - Key? key, + super.key, required this.model, required this.parentContext, - }) : super(key: key); + }); final HomeViewModel model; final BuildContext parentContext; diff --git a/lib/ui/widgets/patcherView/app_selector_card.dart b/lib/ui/widgets/patcherView/app_selector_card.dart index ec2ba3888e..15f078d52c 100644 --- a/lib/ui/widgets/patcherView/app_selector_card.dart +++ b/lib/ui/widgets/patcherView/app_selector_card.dart @@ -8,9 +8,9 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; class AppSelectorCard extends StatelessWidget { const AppSelectorCard({ - Key? key, + super.key, required this.onPressed, - }) : super(key: key); + }); final Function() onPressed; @override diff --git a/lib/ui/widgets/patcherView/patch_selector_card.dart b/lib/ui/widgets/patcherView/patch_selector_card.dart index 8417ab8694..35162b7fcb 100644 --- a/lib/ui/widgets/patcherView/patch_selector_card.dart +++ b/lib/ui/widgets/patcherView/patch_selector_card.dart @@ -7,9 +7,9 @@ import 'package:revanced_manager/ui/widgets/shared/custom_card.dart'; class PatchSelectorCard extends StatelessWidget { const PatchSelectorCard({ - Key? key, + super.key, required this.onPressed, - }) : super(key: key); + }); final Function() onPressed; @override diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index a8ace9cb13..cfeb419f37 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -10,7 +10,7 @@ import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart'; // ignore: must_be_immutable class PatchItem extends StatefulWidget { PatchItem({ - Key? key, + super.key, required this.name, required this.simpleName, required this.description, @@ -23,7 +23,7 @@ class PatchItem extends StatefulWidget { required this.onChanged, required this.navigateToOptions, required this.isChangeEnabled, - }) : super(key: key); + }); final String name; final String simpleName; final String description; diff --git a/lib/ui/widgets/settingsView/about_widget.dart b/lib/ui/widgets/settingsView/about_widget.dart index a6657f61f3..1b087d5a1b 100644 --- a/lib/ui/widgets/settingsView/about_widget.dart +++ b/lib/ui/widgets/settingsView/about_widget.dart @@ -4,7 +4,7 @@ import 'package:revanced_manager/gen/strings.g.dart'; import 'package:revanced_manager/utils/about_info.dart'; class AboutWidget extends StatefulWidget { - const AboutWidget({Key? key, this.padding}) : super(key: key); + const AboutWidget({super.key, this.padding}); final EdgeInsetsGeometry? padding; diff --git a/lib/ui/widgets/settingsView/custom_switch.dart b/lib/ui/widgets/settingsView/custom_switch.dart index 8328c90b26..75229bb03e 100644 --- a/lib/ui/widgets/settingsView/custom_switch.dart +++ b/lib/ui/widgets/settingsView/custom_switch.dart @@ -2,10 +2,10 @@ import 'package:flutter/material.dart'; class CustomSwitch extends StatelessWidget { const CustomSwitch({ - Key? key, + super.key, required this.onChanged, required this.value, - }) : super(key: key); + }); final ValueChanged onChanged; final bool value; diff --git a/lib/ui/widgets/settingsView/custom_switch_tile.dart b/lib/ui/widgets/settingsView/custom_switch_tile.dart index f17f967082..3bf563a5a7 100644 --- a/lib/ui/widgets/settingsView/custom_switch_tile.dart +++ b/lib/ui/widgets/settingsView/custom_switch_tile.dart @@ -3,13 +3,13 @@ import 'package:revanced_manager/ui/widgets/settingsView/custom_switch.dart'; class CustomSwitchTile extends StatelessWidget { const CustomSwitchTile({ - Key? key, + super.key, required this.title, required this.subtitle, required this.value, required this.onTap, this.padding, - }) : super(key: key); + }); final Widget title; final Widget subtitle; final bool value; diff --git a/lib/ui/widgets/settingsView/custom_text_field.dart b/lib/ui/widgets/settingsView/custom_text_field.dart index 6f2b8a76a0..986b2ac685 100644 --- a/lib/ui/widgets/settingsView/custom_text_field.dart +++ b/lib/ui/widgets/settingsView/custom_text_field.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; class CustomTextField extends StatelessWidget { const CustomTextField({ - Key? key, + super.key, required this.inputController, required this.label, required this.hint, this.leadingIcon, required this.onChanged, - }) : super(key: key); + }); final TextEditingController inputController; final Widget label; final String hint; diff --git a/lib/ui/widgets/settingsView/settings_require_suggested_app_version.dart b/lib/ui/widgets/settingsView/settings_require_suggested_app_version.dart index d30b60342c..fa9e53a803 100644 --- a/lib/ui/widgets/settingsView/settings_require_suggested_app_version.dart +++ b/lib/ui/widgets/settingsView/settings_require_suggested_app_version.dart @@ -28,9 +28,8 @@ class _SRequireSuggestedAppVersionState subtitle: Text(t.settingsView.requireSuggestedAppVersionHint), value: _settingsViewModel.isRequireSuggestedAppVersionEnabled(), onChanged: (value) async { - await _settingsViewModel.showRequireSuggestedAppVersionDialog( - context, value,); - setState(() {}); + await _settingsViewModel.showRequireSuggestedAppVersionDialog(context, value,); + setState(() {}); }, ); } diff --git a/lib/ui/widgets/settingsView/settings_section.dart b/lib/ui/widgets/settingsView/settings_section.dart index c62c5352bc..697dcbd4cf 100644 --- a/lib/ui/widgets/settingsView/settings_section.dart +++ b/lib/ui/widgets/settingsView/settings_section.dart @@ -2,10 +2,10 @@ import 'package:flutter/material.dart'; class SettingsSection extends StatelessWidget { const SettingsSection({ - Key? key, + super.key, required this.title, required this.children, - }) : super(key: key); + }); final String title; final List children; diff --git a/lib/ui/widgets/settingsView/settings_tile_dialog.dart b/lib/ui/widgets/settingsView/settings_tile_dialog.dart index 5c65c23d07..eed856cb02 100644 --- a/lib/ui/widgets/settingsView/settings_tile_dialog.dart +++ b/lib/ui/widgets/settingsView/settings_tile_dialog.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; class SettingsTileDialog extends StatelessWidget { const SettingsTileDialog({ - Key? key, + super.key, required this.title, required this.subtitle, required this.onTap, this.padding, - }) : super(key: key); + }); final String title; final String subtitle; final Function()? onTap; diff --git a/lib/ui/widgets/settingsView/social_media_item.dart b/lib/ui/widgets/settingsView/social_media_item.dart index 86971a2762..78e8eb9406 100644 --- a/lib/ui/widgets/settingsView/social_media_item.dart +++ b/lib/ui/widgets/settingsView/social_media_item.dart @@ -3,12 +3,12 @@ import 'package:url_launcher/url_launcher.dart'; class SocialMediaItem extends StatelessWidget { const SocialMediaItem({ - Key? key, + super.key, this.icon, required this.title, this.subtitle, this.url, - }) : super(key: key); + }); final Widget? icon; final Widget title; final Widget? subtitle; diff --git a/lib/ui/widgets/settingsView/social_media_widget.dart b/lib/ui/widgets/settingsView/social_media_widget.dart index faee63c11d..7bec8b1c6d 100644 --- a/lib/ui/widgets/settingsView/social_media_widget.dart +++ b/lib/ui/widgets/settingsView/social_media_widget.dart @@ -8,9 +8,9 @@ import 'package:revanced_manager/ui/widgets/shared/custom_icon.dart'; class SocialMediaWidget extends StatelessWidget { const SocialMediaWidget({ - Key? key, + super.key, this.padding, - }) : super(key: key); + }); final EdgeInsetsGeometry? padding; @override diff --git a/lib/ui/widgets/shared/application_item.dart b/lib/ui/widgets/shared/application_item.dart index f8cba060c8..630ffe0dab 100644 --- a/lib/ui/widgets/shared/application_item.dart +++ b/lib/ui/widgets/shared/application_item.dart @@ -8,12 +8,12 @@ import 'package:timeago/timeago.dart'; class ApplicationItem extends StatefulWidget { const ApplicationItem({ - Key? key, + super.key, required this.icon, required this.name, required this.patchDate, required this.onPressed, - }) : super(key: key); + }); final Uint8List icon; final String name; final DateTime patchDate; diff --git a/lib/ui/widgets/shared/custom_card.dart b/lib/ui/widgets/shared/custom_card.dart index 34b3c72860..17b3d0e1e4 100644 --- a/lib/ui/widgets/shared/custom_card.dart +++ b/lib/ui/widgets/shared/custom_card.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; class CustomCard extends StatelessWidget { const CustomCard({ - Key? key, + super.key, this.isFilled = true, required this.child, this.onTap, this.padding, this.backgroundColor, - }) : super(key: key); + }); final bool isFilled; final Widget child; final Function()? onTap; diff --git a/lib/ui/widgets/shared/custom_chip.dart b/lib/ui/widgets/shared/custom_chip.dart index 8f3bb41831..c0567ce23f 100644 --- a/lib/ui/widgets/shared/custom_chip.dart +++ b/lib/ui/widgets/shared/custom_chip.dart @@ -2,11 +2,11 @@ import 'package:flutter/material.dart'; class CustomChip extends StatelessWidget { const CustomChip({ - Key? key, + super.key, required this.label, this.isSelected = false, this.onSelected, - }) : super(key: key); + }); final Widget label; final bool isSelected; final Function(bool)? onSelected; diff --git a/lib/ui/widgets/shared/custom_material_button.dart b/lib/ui/widgets/shared/custom_material_button.dart index 2ff80e4cf2..c861a709ea 100644 --- a/lib/ui/widgets/shared/custom_material_button.dart +++ b/lib/ui/widgets/shared/custom_material_button.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; class CustomMaterialButton extends StatelessWidget { const CustomMaterialButton({ - Key? key, + super.key, required this.label, this.isFilled = true, this.isExpanded = false, required this.onPressed, - }) : super(key: key); + }); final Widget label; final bool isFilled; final bool isExpanded; @@ -49,13 +49,13 @@ class CustomMaterialButton extends StatelessWidget { // ignore: must_be_immutable class TimerButton extends StatefulWidget { TimerButton({ - Key? key, + super.key, required this.seconds, required this.isRunning, required this.onTimerEnd, this.label = const Text(''), this.isFilled = true, - }) : super(key: key); + }); Widget label; bool isFilled; int seconds; diff --git a/lib/ui/widgets/shared/custom_popup_menu.dart b/lib/ui/widgets/shared/custom_popup_menu.dart deleted file mode 100644 index aaf2412563..0000000000 --- a/lib/ui/widgets/shared/custom_popup_menu.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:flutter/material.dart'; - -class CustomPopupMenu extends StatelessWidget { - const CustomPopupMenu({ - Key? key, - required this.onSelected, - required this.children, - }) : super(key: key); - final Function(dynamic) onSelected; - final Map children; - - @override - Widget build(BuildContext context) { - return Theme( - data: Theme.of(context).copyWith(useMaterial3: false), - child: PopupMenuButton( - icon: Icon( - Icons.more_vert, - color: Theme.of(context).colorScheme.secondary, - ), - onSelected: onSelected, - itemBuilder: (context) => children.entries - .map( - (entry) => PopupMenuItem( - padding: const EdgeInsets.all(16.0).copyWith(right: 20), - value: entry.key, - child: entry.value, - ), - ) - .toList(), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(24), - ), - color: Theme.of(context).colorScheme.secondaryContainer, - position: PopupMenuPosition.under, - ), - ); - } -} diff --git a/lib/ui/widgets/shared/custom_sliver_app_bar.dart b/lib/ui/widgets/shared/custom_sliver_app_bar.dart index 144bd6ab8e..08b75af2c2 100644 --- a/lib/ui/widgets/shared/custom_sliver_app_bar.dart +++ b/lib/ui/widgets/shared/custom_sliver_app_bar.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; class CustomSliverAppBar extends StatelessWidget { const CustomSliverAppBar({ - Key? key, + super.key, required this.title, this.actions, this.bottom, this.isMainView = false, this.onBackButtonPressed, - }) : super(key: key); + }); final Widget title; final List? actions; final PreferredSizeWidget? bottom; diff --git a/lib/ui/widgets/shared/open_container_wrapper.dart b/lib/ui/widgets/shared/open_container_wrapper.dart index f5b1c642b9..458e8937da 100644 --- a/lib/ui/widgets/shared/open_container_wrapper.dart +++ b/lib/ui/widgets/shared/open_container_wrapper.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; class OpenContainerWrapper extends StatelessWidget { const OpenContainerWrapper({ - Key? key, + super.key, required this.openBuilder, required this.closedBuilder, - }) : super(key: key); + }); final OpenContainerBuilder openBuilder; final CloseContainerBuilder closedBuilder; diff --git a/lib/ui/widgets/shared/search_bar.dart b/lib/ui/widgets/shared/search_bar.dart index e48e3031f0..862584af66 100644 --- a/lib/ui/widgets/shared/search_bar.dart +++ b/lib/ui/widgets/shared/search_bar.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; class SearchBar extends StatefulWidget { const SearchBar({ - Key? key, + super.key, required this.hintText, this.showSelectIcon = false, this.onSelectAll, required this.onQueryChanged, - }) : super(key: key); + }); final String? hintText; final bool showSelectIcon; final Function(bool)? onSelectAll; diff --git a/pubspec.yaml b/pubspec.yaml index ea3157c43c..8c38222fc8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -88,7 +88,7 @@ dev_dependencies: build_runner: any json_serializable: ^6.6.1 flutter_launcher_icons: ^0.13.0 - flutter_lints: ^2.0.1 + flutter_lints: ^3.0.1 flutter_test: sdk: flutter injectable_generator: ^2.1.5