diff --git a/lib/services/github_api.dart b/lib/services/github_api.dart index f3a8af40..bdf5a105 100644 --- a/lib/services/github_api.dart +++ b/lib/services/github_api.dart @@ -73,20 +73,29 @@ class GithubAPI { } Future?> getLatestManagerRelease( - String repoName, - ) async { + String repoName, + ) async { try { final response = await _dio.get( '/repos/$repoName/releases', ); final Map releases = response.data[0]; int updates = 0; - final String currentVersion = await ManagerAPI().getCurrentManagerVersion(); + final String currentVersion = + await ManagerAPI().getCurrentManagerVersion(); while (response.data[updates]['tag_name'] != 'v$currentVersion') { updates++; } - for(int i = 1; i < updates; i++){ - releases.update('body', (value) => value + '\n' + '# '+ response.data[i]['tag_name']+'\n' + response.data[i]['body']); + for (int i = 1; i < updates; i++) { + releases.update( + 'body', + (value) => + value + + '\n' + + '# ' + + response.data[i]['tag_name'] + + '\n' + + response.data[i]['body']); } return releases; } on Exception catch (e) { diff --git a/lib/services/revanced_api.dart b/lib/services/revanced_api.dart index a8bec19c..bc3562ba 100644 --- a/lib/services/revanced_api.dart +++ b/lib/services/revanced_api.dart @@ -140,7 +140,8 @@ class RevancedAPI { return null; } - StreamController managerUpdateProgress = StreamController.broadcast(); + StreamController managerUpdateProgress = + StreamController.broadcast(); void updateManagerDownloadProgress(int progress) { managerUpdateProgress.add(progress.toDouble()); diff --git a/lib/ui/views/settings/settings_viewmodel.dart b/lib/ui/views/settings/settings_viewmodel.dart index 82c09ec1..3840dafb 100644 --- a/lib/ui/views/settings/settings_viewmodel.dart +++ b/lib/ui/views/settings/settings_viewmodel.dart @@ -17,8 +17,7 @@ import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; class SettingsViewModel extends BaseViewModel { - final NavigationService _navigationService = - locator(); + final NavigationService _navigationService = locator(); final ManagerAPI _managerAPI = locator(); final Toast _toast = locator(); @@ -63,11 +62,8 @@ class SettingsViewModel extends BaseViewModel { try { final File outFile = File(_managerAPI.storedPatchesFile); if (outFile.existsSync()) { - final String dateTime = DateTime.now() - .toString() - .replaceAll(' ', '_') - .split('.') - .first; + final String dateTime = + DateTime.now().toString().replaceAll(' ', '_').split('.').first; await CRFileSaver.saveFileWithDialog( SaveFileDialogParams( sourceFilePath: outFile.path, @@ -87,8 +83,7 @@ class SettingsViewModel extends BaseViewModel { Future importPatches() async { try { - final FilePickerResult? result = - await FilePicker.platform.pickFiles( + final FilePickerResult? result = await FilePicker.platform.pickFiles( type: FileType.custom, allowedExtensions: ['json'], ); @@ -109,7 +104,7 @@ class SettingsViewModel extends BaseViewModel { } } - Future exportKeystore() async { + Future exportKeystore() async { try { final File outFile = File(_managerAPI.keystoreFile); if (outFile.existsSync()) { @@ -138,7 +133,7 @@ class SettingsViewModel extends BaseViewModel { if (result != null && result.files.single.path != null) { final File inFile = File(result.files.single.path!); inFile.copySync(_managerAPI.keystoreFile); - + _toast.showBottom('settingsView.importedKeystore'); } } on Exception catch (e) { diff --git a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart index c1231b59..51c51b72 100644 --- a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart +++ b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart @@ -34,7 +34,8 @@ class AppSkeletonLoader extends StatelessWidget { style: SkeletonLineStyle( height: 20, width: screenWidth * 0.4, - borderRadius: const BorderRadius.all(Radius.circular(10)), + borderRadius: + const BorderRadius.all(Radius.circular(10)), ), ), ), @@ -45,7 +46,8 @@ class AppSkeletonLoader extends StatelessWidget { style: SkeletonLineStyle( height: 15, width: screenWidth * 0.6, - borderRadius: const BorderRadius.all(Radius.circular(10)), + borderRadius: + const BorderRadius.all(Radius.circular(10)), ), ), ), @@ -56,7 +58,8 @@ class AppSkeletonLoader extends StatelessWidget { style: SkeletonLineStyle( height: 15, width: screenWidth * 0.5, - borderRadius: const BorderRadius.all(Radius.circular(10)), + borderRadius: + const BorderRadius.all(Radius.circular(10)), ), ), ), diff --git a/lib/ui/widgets/appSelectorView/installed_app_item.dart b/lib/ui/widgets/appSelectorView/installed_app_item.dart index fc1a97e1..5d811427 100644 --- a/lib/ui/widgets/appSelectorView/installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/installed_app_item.dart @@ -66,7 +66,7 @@ class _InstalledAppItemState extends State { context, 'installed', translationParams: { - 'version':'v${widget.installedVersion}' + 'version': 'v${widget.installedVersion}' }, ), ), @@ -75,8 +75,9 @@ class _InstalledAppItemState extends State { I18nText( 'suggested', translationParams: { - 'version' : widget.suggestedVersion.isEmpty - ? FlutterI18n.translate(context, 'appSelectorCard.allVersions') + 'version': widget.suggestedVersion.isEmpty + ? FlutterI18n.translate( + context, 'appSelectorCard.allVersions') : 'v${widget.suggestedVersion}', }, ), diff --git a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart index fa94eb2b..c0013a0d 100644 --- a/lib/ui/widgets/appSelectorView/not_installed_app_item.dart +++ b/lib/ui/widgets/appSelectorView/not_installed_app_item.dart @@ -60,8 +60,7 @@ class _NotInstalledAppItem extends State { child: Text( '', style: TextStyle( - color: - Theme.of(context).textTheme.titleLarge!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), @@ -70,8 +69,9 @@ class _NotInstalledAppItem extends State { I18nText( 'suggested', translationParams: { - 'version' : widget.suggestedVersion.isEmpty - ? FlutterI18n.translate(context, 'appSelectorCard.allVersions') + 'version': widget.suggestedVersion.isEmpty + ? FlutterI18n.translate( + context, 'appSelectorCard.allVersions') : 'v${widget.suggestedVersion}', }, ), diff --git a/lib/ui/widgets/homeView/update_confirmation_dialog.dart b/lib/ui/widgets/homeView/update_confirmation_dialog.dart index 108c5d78..16a1f1be 100644 --- a/lib/ui/widgets/homeView/update_confirmation_dialog.dart +++ b/lib/ui/widgets/homeView/update_confirmation_dialog.dart @@ -45,8 +45,7 @@ class UpdateConfirmationDialog extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ I18nText( 'homeView.updateDialogTitle', @@ -63,14 +62,12 @@ class UpdateConfirmationDialog extends StatelessWidget { children: [ Icon( Icons.new_releases_outlined, - color: Theme.of(context) - .colorScheme - .secondary, + color: + Theme.of(context).colorScheme.secondary, ), const SizedBox(width: 8.0), Text( - snapshot.data!['tag_name'] ?? - 'Unknown', + snapshot.data!['tag_name'] ?? 'Unknown', style: TextStyle( fontSize: 20, fontWeight: FontWeight.w500, @@ -96,8 +93,7 @@ class UpdateConfirmationDialog extends StatelessWidget { ), ), Padding( - padding: - const EdgeInsets.only(left: 24.0, bottom: 12.0), + padding: const EdgeInsets.only(left: 24.0, bottom: 12.0), child: I18nText( 'homeView.updateChangelogTitle', child: Text( @@ -113,12 +109,9 @@ class UpdateConfirmationDialog extends StatelessWidget { ), ), Container( - margin: - const EdgeInsets.symmetric(horizontal: 24.0), + margin: const EdgeInsets.symmetric(horizontal: 24.0), decoration: BoxDecoration( - color: Theme.of(context) - .colorScheme - .secondaryContainer, + color: Theme.of(context).colorScheme.secondaryContainer, borderRadius: BorderRadius.circular(12.0), ), child: Markdown( diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index 267fb1c3..d9173d55 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -42,7 +42,9 @@ class PatchItem extends StatefulWidget { class _PatchItemState extends State { @override Widget build(BuildContext context) { - widget.isSelected = widget.isSelected && (!widget.isUnsupported || widget._managerAPI.areExperimentalPatchesEnabled()); + widget.isSelected = widget.isSelected && + (!widget.isUnsupported || + widget._managerAPI.areExperimentalPatchesEnabled()); return Padding( padding: const EdgeInsets.symmetric(vertical: 4.0), child: Opacity( @@ -117,7 +119,7 @@ class _PatchItemState extends State { value: widget.isSelected, activeColor: Theme.of(context).colorScheme.primary, checkColor: - Theme.of(context).colorScheme.secondaryContainer, + Theme.of(context).colorScheme.secondaryContainer, side: BorderSide( width: 2.0, color: Theme.of(context).colorScheme.primary, @@ -128,14 +130,15 @@ class _PatchItemState extends State { !widget._managerAPI .areExperimentalPatchesEnabled()) { widget.isSelected = false; - widget.toast - .showBottom('patchItem.unsupportedPatchVersion'); + widget.toast.showBottom( + 'patchItem.unsupportedPatchVersion'); } else { widget.isSelected = newValue!; } if (widget.isUnsupported && widget.isSelected && - !selectedUnsupportedPatches.contains(widget.name)) { + !selectedUnsupportedPatches + .contains(widget.name)) { selectedUnsupportedPatches.add(widget.name); } }); diff --git a/lib/ui/widgets/settingsView/settings_experimental_patches.dart b/lib/ui/widgets/settingsView/settings_experimental_patches.dart index 79f5e7fe..1b2e2542 100644 --- a/lib/ui/widgets/settingsView/settings_experimental_patches.dart +++ b/lib/ui/widgets/settingsView/settings_experimental_patches.dart @@ -34,9 +34,11 @@ class _SExperimentalPatchesState extends State { setState(() { _settingsViewModel.useExperimentalPatches(value); }); - if(!value) { + if (!value) { for (final patch in selectedUnsupportedPatches) { - PatchesSelectorViewModel().selectedPatches.removeWhere((element) => patch == element.name); + PatchesSelectorViewModel() + .selectedPatches + .removeWhere((element) => patch == element.name); } selectedUnsupportedPatches.clear(); }