mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 09:31:13 +00:00
refactor: Fix callbacks returning sets
This commit is contained in:
parent
02870c3149
commit
725c592086
|
@ -335,13 +335,12 @@ class BackupDetailsPage extends StatelessWidget {
|
|||
'backup.forget_snapshot_alert'.tr(),
|
||||
actionButtonTitle:
|
||||
'backup.forget_snapshot'.tr(),
|
||||
actionButtonOnPressed: () => {
|
||||
actionButtonOnPressed: () =>
|
||||
context.read<BackupsBloc>().add(
|
||||
ForgetSnapshot(
|
||||
backup.id,
|
||||
),
|
||||
),
|
||||
},
|
||||
);
|
||||
},
|
||||
title: Text(
|
||||
|
@ -416,11 +415,9 @@ class BackupDetailsPage extends StatelessWidget {
|
|||
),
|
||||
onTap: preventActions
|
||||
? null
|
||||
: () => {
|
||||
context
|
||||
: () => context
|
||||
.read<BackupsBloc>()
|
||||
.add(const ForceSnapshotListUpdate()),
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Divider(),
|
||||
|
@ -444,7 +441,7 @@ class BackupDetailsPage extends StatelessWidget {
|
|||
),
|
||||
// onTap: preventActions
|
||||
// ? null
|
||||
// : () => {context.read<BackupsCubit>().reuploadKey()},
|
||||
// : () => context.read<BackupsCubit>().reuploadKey(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -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
|
||||
actionButtonOnPressed: () => context
|
||||
.read<BackupsBloc>()
|
||||
.add(ForgetSnapshot(backup.id)),
|
||||
},
|
||||
);
|
||||
},
|
||||
title: Text(
|
||||
|
|
|
@ -80,9 +80,8 @@ class _ServicePageState extends State<ServicePage> {
|
|||
const SizedBox(height: 8),
|
||||
ListTile(
|
||||
iconColor: Theme.of(context).colorScheme.onBackground,
|
||||
onTap: () => {
|
||||
onTap: () =>
|
||||
context.read<ServicesBloc>().add(ServiceRestart(service)),
|
||||
},
|
||||
leading: const Icon(Icons.restart_alt_outlined),
|
||||
title: Text(
|
||||
'service_page.restart'.tr(),
|
||||
|
@ -92,14 +91,12 @@ class _ServicePageState extends State<ServicePage> {
|
|||
),
|
||||
ListTile(
|
||||
iconColor: Theme.of(context).colorScheme.onBackground,
|
||||
onTap: () => {
|
||||
context.read<JobsCubit>().addJob(
|
||||
onTap: () => context.read<JobsCubit>().addJob(
|
||||
ServiceToggleJob(
|
||||
service: service,
|
||||
needToTurnOn: serviceDisabled,
|
||||
),
|
||||
),
|
||||
},
|
||||
leading: const Icon(Icons.power_settings_new),
|
||||
title: Text(
|
||||
serviceDisabled
|
||||
|
|
|
@ -51,10 +51,7 @@ class _ServicesPageState extends State<ServicesPage> {
|
|||
iconData: BrandIcons.box,
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
// Create a ServicesRelaod event and wait for the state to change.
|
||||
await context.read<ServicesBloc>().awaitReload();
|
||||
},
|
||||
onRefresh: context.read<ServicesBloc>().awaitReload,
|
||||
child: ListView(
|
||||
padding: paddingH15V0,
|
||||
children: [
|
||||
|
|
|
@ -46,8 +46,7 @@ class UserDetailsPage extends StatelessWidget {
|
|||
const SizedBox(height: 8),
|
||||
ListTile(
|
||||
iconColor: Theme.of(context).colorScheme.onBackground,
|
||||
onTap: () => {
|
||||
showModalBottomSheet(
|
||||
onTap: () => showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
useRootNavigator: true,
|
||||
|
@ -56,7 +55,6 @@ class UserDetailsPage extends StatelessWidget {
|
|||
child: ResetPassword(user: user),
|
||||
),
|
||||
),
|
||||
},
|
||||
leading: const Icon(Icons.lock_reset_outlined),
|
||||
title: Text(
|
||||
'users.reset_password'.tr(),
|
||||
|
@ -87,8 +85,7 @@ class _DeleteUserTile extends StatelessWidget {
|
|||
Widget build(final BuildContext context) => ListTile(
|
||||
iconColor: Theme.of(context).colorScheme.error,
|
||||
textColor: Theme.of(context).colorScheme.error,
|
||||
onTap: () => {
|
||||
showDialog(
|
||||
onTap: () => showDialog(
|
||||
context: context,
|
||||
// useRootNavigator: false,
|
||||
builder: (final BuildContext context) => AlertDialog(
|
||||
|
@ -125,7 +122,6 @@ class _DeleteUserTile extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
},
|
||||
leading: const Icon(Icons.person_remove_outlined),
|
||||
title: Text(
|
||||
'users.delete_user'.tr(),
|
||||
|
|
Loading…
Reference in a new issue