diff --git a/lib/ui/pages/backups/backup_details.dart b/lib/ui/pages/backups/backup_details.dart index 5dd94a08..6eb9d009 100644 --- a/lib/ui/pages/backups/backup_details.dart +++ b/lib/ui/pages/backups/backup_details.dart @@ -335,13 +335,12 @@ class BackupDetailsPage extends StatelessWidget { 'backup.forget_snapshot_alert'.tr(), actionButtonTitle: 'backup.forget_snapshot'.tr(), - actionButtonOnPressed: () => { - context.read().add( - ForgetSnapshot( - backup.id, + actionButtonOnPressed: () => + context.read().add( + ForgetSnapshot( + backup.id, + ), ), - ), - }, ); }, title: Text( @@ -416,11 +415,9 @@ class BackupDetailsPage extends StatelessWidget { ), onTap: preventActions ? null - : () => { - context - .read() - .add(const ForceSnapshotListUpdate()), - }, + : () => context + .read() + .add(const ForceSnapshotListUpdate()), ), const SizedBox(height: 8), const Divider(), @@ -444,7 +441,7 @@ class BackupDetailsPage extends StatelessWidget { ), // onTap: preventActions // ? null - // : () => {context.read().reuploadKey()}, + // : () => context.read().reuploadKey(), ), ], ), diff --git a/lib/ui/pages/backups/backups_list.dart b/lib/ui/pages/backups/backups_list.dart index fd2b541e..20843ef4 100644 --- a/lib/ui/pages/backups/backups_list.dart +++ b/lib/ui/pages/backups/backups_list.dart @@ -75,11 +75,9 @@ class BackupsListPage extends StatelessWidget { alertTitle: 'backup.forget_snapshot'.tr(), description: 'backup.forget_snapshot_alert'.tr(), actionButtonTitle: 'backup.forget_snapshot'.tr(), - actionButtonOnPressed: () => { - context - .read() - .add(ForgetSnapshot(backup.id)), - }, + actionButtonOnPressed: () => context + .read() + .add(ForgetSnapshot(backup.id)), ); }, title: Text( diff --git a/lib/ui/pages/services/service_page.dart b/lib/ui/pages/services/service_page.dart index bd18e5ea..a7c2be34 100644 --- a/lib/ui/pages/services/service_page.dart +++ b/lib/ui/pages/services/service_page.dart @@ -80,9 +80,8 @@ class _ServicePageState extends State { const SizedBox(height: 8), ListTile( iconColor: Theme.of(context).colorScheme.onBackground, - onTap: () => { - context.read().add(ServiceRestart(service)), - }, + onTap: () => + context.read().add(ServiceRestart(service)), leading: const Icon(Icons.restart_alt_outlined), title: Text( 'service_page.restart'.tr(), @@ -92,14 +91,12 @@ class _ServicePageState extends State { ), ListTile( iconColor: Theme.of(context).colorScheme.onBackground, - onTap: () => { - context.read().addJob( - ServiceToggleJob( - service: service, - needToTurnOn: serviceDisabled, - ), + onTap: () => context.read().addJob( + ServiceToggleJob( + service: service, + needToTurnOn: serviceDisabled, ), - }, + ), leading: const Icon(Icons.power_settings_new), title: Text( serviceDisabled diff --git a/lib/ui/pages/services/services.dart b/lib/ui/pages/services/services.dart index ba713ccc..994e2040 100644 --- a/lib/ui/pages/services/services.dart +++ b/lib/ui/pages/services/services.dart @@ -51,10 +51,7 @@ class _ServicesPageState extends State { iconData: BrandIcons.box, ) : RefreshIndicator( - onRefresh: () async { - // Create a ServicesRelaod event and wait for the state to change. - await context.read().awaitReload(); - }, + onRefresh: context.read().awaitReload, child: ListView( padding: paddingH15V0, children: [ diff --git a/lib/ui/pages/users/user_details.dart b/lib/ui/pages/users/user_details.dart index 9523ccf4..0dd2c6d8 100644 --- a/lib/ui/pages/users/user_details.dart +++ b/lib/ui/pages/users/user_details.dart @@ -46,17 +46,15 @@ class UserDetailsPage extends StatelessWidget { const SizedBox(height: 8), ListTile( iconColor: Theme.of(context).colorScheme.onBackground, - onTap: () => { - showModalBottomSheet( - context: context, - isScrollControlled: true, - useRootNavigator: true, - builder: (final BuildContext context) => Padding( - padding: MediaQuery.of(context).viewInsets, - child: ResetPassword(user: user), - ), + onTap: () => showModalBottomSheet( + context: context, + isScrollControlled: true, + useRootNavigator: true, + builder: (final BuildContext context) => Padding( + padding: MediaQuery.of(context).viewInsets, + child: ResetPassword(user: user), ), - }, + ), leading: const Icon(Icons.lock_reset_outlined), title: Text( 'users.reset_password'.tr(), @@ -87,45 +85,43 @@ class _DeleteUserTile extends StatelessWidget { Widget build(final BuildContext context) => ListTile( iconColor: Theme.of(context).colorScheme.error, textColor: Theme.of(context).colorScheme.error, - onTap: () => { - showDialog( - context: context, - // useRootNavigator: false, - builder: (final BuildContext context) => AlertDialog( - title: Text('basis.confirmation'.tr()), - content: SingleChildScrollView( - child: ListBody( - children: [ - Text( - 'users.delete_confirm_question'.tr(), - ), - ], - ), - ), - actions: [ - TextButton( - child: Text('basis.cancel'.tr()), - onPressed: () { - context.router.pop(); - }, - ), - TextButton( - child: Text( - 'basis.delete'.tr(), - style: TextStyle( - color: Theme.of(context).colorScheme.error, - ), + onTap: () => showDialog( + context: context, + // useRootNavigator: false, + builder: (final BuildContext context) => AlertDialog( + title: Text('basis.confirmation'.tr()), + content: SingleChildScrollView( + child: ListBody( + children: [ + Text( + 'users.delete_confirm_question'.tr(), ), - onPressed: () { - context.read().addJob(DeleteUserJob(user: user)); - context.router.childControllers.first.pop(); - context.router.pop(); - }, - ), - ], + ], + ), ), + actions: [ + TextButton( + child: Text('basis.cancel'.tr()), + onPressed: () { + context.router.pop(); + }, + ), + TextButton( + child: Text( + 'basis.delete'.tr(), + style: TextStyle( + color: Theme.of(context).colorScheme.error, + ), + ), + onPressed: () { + context.read().addJob(DeleteUserJob(user: user)); + context.router.childControllers.first.pop(); + context.router.pop(); + }, + ), + ], ), - }, + ), leading: const Icon(Icons.person_remove_outlined), title: Text( 'users.delete_user'.tr(),