feat(mobile): clear local storage option (#4635)

* feat(mobile): clear local storage option

* en json
This commit is contained in:
Alex 2023-10-25 09:53:16 -05:00 committed by GitHub
parent e47a11b8ba
commit aefd052888
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 101 additions and 15 deletions

View file

@ -82,23 +82,33 @@ class NotificationSetting extends HookConsumerWidget {
if (!hasPermission)
ListTile(
leading: const Icon(Icons.notifications_outlined),
title: const Text('notification_permission_list_tile_title').tr(),
title: Text(
'notification_permission_list_tile_title',
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(fontWeight: FontWeight.bold),
).tr(),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('notification_permission_list_tile_content').tr(),
Text(
'notification_permission_list_tile_content',
style: Theme.of(context).textTheme.labelMedium,
).tr(),
const SizedBox(height: 8),
ElevatedButton(
onPressed: ()
=> ref.watch(notificationPermissionProvider.notifier)
.requestNotificationPermission().then((permission) {
if (permission == PermissionStatus.permanentlyDenied) {
showPermissionsDialog();
}
onPressed: () => ref
.watch(notificationPermissionProvider.notifier)
.requestNotificationPermission()
.then((permission) {
if (permission == PermissionStatus.permanentlyDenied) {
showPermissionsDialog();
}
}),
child:
const Text('notification_permission_list_tile_enable_button')
.tr(),
child: const Text(
'notification_permission_list_tile_enable_button',
).tr(),
),
],
),
@ -130,7 +140,8 @@ class NotificationSetting extends HookConsumerWidget {
).tr(args: [formattedValue]),
subtitle: Slider(
value: sliderValue.value,
onChanged: !hasPermission ? null : (double v) => sliderValue.value = v,
onChanged:
!hasPermission ? null : (double v) => sliderValue.value = v,
onChangeEnd: (double v) => appSettingService.setSetting(
AppSettingsEnum.uploadErrorNotificationGracePeriod,
v.toInt(),