diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index da81d593..604b53ca 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -166,7 +166,7 @@ class HomeViewModel extends BaseViewModel { title: I18nText('homeView.updateDialogTitle'), backgroundColor: Theme.of(context).colorScheme.secondaryContainer, content: I18nText('homeView.updateDialogText'), - actions: [ + actions: [ CustomMaterialButton( isFilled: false, label: I18nText('cancelButton'), diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index f29dba69..55826743 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -30,7 +30,7 @@ class InstallerView extends StatelessWidget { ), actions: [ Visibility( - visible: !model.isPatching, + visible: !model.isPatching && model.hasErrors, child: CustomPopupMenu( onSelected: (value) => model.onMenuSelection(value), children: { @@ -89,7 +89,7 @@ class InstallerView extends StatelessWidget { child: Align( alignment: Alignment.bottomCenter, child: Visibility( - visible: !model.isPatching, + visible: !model.isPatching && !model.hasErrors, child: Padding( padding: const EdgeInsets.all(20.0).copyWith(top: 0.0), child: Row( diff --git a/lib/ui/views/installer/installer_viewmodel.dart b/lib/ui/views/installer/installer_viewmodel.dart index dd89a11d..b72f2fcf 100644 --- a/lib/ui/views/installer/installer_viewmodel.dart +++ b/lib/ui/views/installer/installer_viewmodel.dart @@ -26,6 +26,7 @@ class InstallerViewModel extends BaseViewModel { String headerLogs = ''; bool isPatching = true; bool isInstalled = false; + bool hasErrors = false; Future initialize(BuildContext context) async { try { @@ -79,6 +80,7 @@ class InstallerViewModel extends BaseViewModel { if (progress == 0.0) { logs = ''; isInstalled = false; + hasErrors = false; } if (header.isNotEmpty) { headerLogs = header; @@ -115,9 +117,11 @@ class InstallerViewModel extends BaseViewModel { update(0.0, '', 'Creating working directory'); await _patcherAPI.runPatcher(_app.packageName, apkFilePath, _patches); } on Exception { + hasErrors = true; update(1.0, 'Aborting...', 'An error occurred! Aborting'); } } else { + hasErrors = true; update(1.0, 'Aborting...', 'No app or patches selected! Aborting'); } try { @@ -144,8 +148,6 @@ class InstallerViewModel extends BaseViewModel { _app.patchDate = DateTime.now(); _app.appliedPatches = _patches.map((p) => p.name).toList(); await _managerAPI.savePatchedApp(_app); - } else { - update(1.0, 'Aborting...', 'An error occurred! Aborting'); } } diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index b68cb707..8087c69a 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -88,7 +88,7 @@ class _PatchesSelectorViewState extends State { tapHeaderToExpand: true, ), header: Column( - children: [ + children: [ GestureDetector( onLongPress: () => expController.toggle(), @@ -138,7 +138,7 @@ class _PatchesSelectorViewState extends State { BorderRadius.circular(12), ), child: Column( - children: [ + children: [ Text( "Patch options", style: GoogleFonts.inter( diff --git a/lib/ui/views/settings/settings_viewmodel.dart b/lib/ui/views/settings/settings_viewmodel.dart index f682a8cf..5d4e8123 100644 --- a/lib/ui/views/settings/settings_viewmodel.dart +++ b/lib/ui/views/settings/settings_viewmodel.dart @@ -100,7 +100,7 @@ class SettingsViewModel extends BaseViewModel { context: context, builder: (context) => AlertDialog( title: Row( - children: [ + children: [ I18nText('settingsView.sourcesLabel'), const Spacer(), IconButton( @@ -160,7 +160,7 @@ class SettingsViewModel extends BaseViewModel { ], ), ), - actions: [ + actions: [ CustomMaterialButton( isFilled: false, label: I18nText('cancelButton'), @@ -196,7 +196,7 @@ class SettingsViewModel extends BaseViewModel { title: I18nText('settingsView.sourcesResetDialogTitle'), backgroundColor: Theme.of(context).colorScheme.secondaryContainer, content: I18nText('settingsView.sourcesResetDialogText'), - actions: [ + actions: [ CustomMaterialButton( isFilled: false, label: I18nText('cancelButton'), diff --git a/lib/ui/widgets/appInfoView/app_info_view.dart b/lib/ui/widgets/appInfoView/app_info_view.dart index 77445822..7587184d 100644 --- a/lib/ui/widgets/appInfoView/app_info_view.dart +++ b/lib/ui/widgets/appInfoView/app_info_view.dart @@ -64,12 +64,12 @@ class AppInfoView extends StatelessWidget { child: IntrinsicHeight( child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ + children: [ InkWell( onTap: () => model.openApp(app), child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Icon( Icons.open_in_new_outlined, color: @@ -99,7 +99,7 @@ class AppInfoView extends StatelessWidget { model.showUninstallAlertDialog(context, app), child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Icon( Icons.delete_outline, color: @@ -131,7 +131,7 @@ class AppInfoView extends StatelessWidget { }, child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Icon( Icons.build_outlined, color: diff --git a/lib/ui/widgets/appInfoView/app_info_viewmodel.dart b/lib/ui/widgets/appInfoView/app_info_viewmodel.dart index 3059aa4c..474f5b64 100644 --- a/lib/ui/widgets/appInfoView/app_info_viewmodel.dart +++ b/lib/ui/widgets/appInfoView/app_info_viewmodel.dart @@ -49,7 +49,7 @@ class AppInfoViewModel extends BaseViewModel { title: I18nText('appInfoView.rootDialogTitle'), backgroundColor: Theme.of(context).colorScheme.secondaryContainer, content: I18nText('appInfoView.rootDialogText'), - actions: [ + actions: [ CustomMaterialButton( label: I18nText('okButton'), onPressed: () => Navigator.of(context).pop(), @@ -64,7 +64,7 @@ class AppInfoViewModel extends BaseViewModel { title: I18nText('appInfoView.uninstallDialogTitle'), backgroundColor: Theme.of(context).colorScheme.secondaryContainer, content: I18nText('appInfoView.uninstallDialogText'), - actions: [ + actions: [ CustomMaterialButton( isFilled: false, label: I18nText('cancelButton'), @@ -105,7 +105,7 @@ class AppInfoViewModel extends BaseViewModel { title: I18nText('appInfoView.appliedPatchesLabel'), backgroundColor: Theme.of(context).colorScheme.secondaryContainer, content: Text(getAppliedPatchesString(app.appliedPatches)), - actions: [ + actions: [ CustomMaterialButton( label: I18nText('okButton'), onPressed: () => Navigator.of(context).pop(), diff --git a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart index cd2dbcce..193b44ec 100644 --- a/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart +++ b/lib/ui/widgets/appSelectorView/app_skeleton_loader.dart @@ -15,7 +15,7 @@ class AppSkeletonLoader extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 8.0), child: SkeletonItem( child: Row( - children: [ + children: [ SkeletonAvatar( style: SkeletonAvatarStyle( width: screenWidth * 0.15, @@ -27,7 +27,7 @@ class AppSkeletonLoader extends StatelessWidget { const SizedBox(width: 16), Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Container( color: Colors.white, height: 34, diff --git a/lib/ui/widgets/patchesSelectorView/patch_item.dart b/lib/ui/widgets/patchesSelectorView/patch_item.dart index ab58d59d..183c3c04 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_item.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_item.dart @@ -154,7 +154,7 @@ class _PatchItemState extends State { '\u2022 ${widget.supportedPackageVersions.join('\n\u2022 ')}', }, ), - actions: [ + actions: [ CustomMaterialButton( label: I18nText('okButton'), onPressed: () => Navigator.of(context).pop(), diff --git a/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart b/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart index 7cb80273..8136a38a 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart @@ -38,7 +38,7 @@ class OptionsFilePicker extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 4.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: [ I18nText( optionName, child: Text(