Skip to content

Commit

Permalink
feat(#636, #681): improve delete data dialog (closes #681)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Dec 21, 2023
1 parent 700d0cb commit 80615ea
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@
"settings_page_account_settings": "Settings",
"settings_page_delete_data": "Delete app data",
"settings_page_delete_data_text": "Are you sure that you want to delete all app data? This also includes your genetic data and will reset the app.",
"settings_page_delete_data_confirmation": "I understand that my genetic data will be deleted and it might not be possible to import it again.",
"settings_page_delete_data_additional_text": "Your genetic data will be deleted and it might not be possible to import it again.",
"settings_page_delete_data_confirmation": "I understand the consequences and want to delete all app data",
"settings_page_more": "More",
"settings_page_onboarding": "Onboarding",
"settings_page_about_us": "About us",
Expand Down
31 changes: 24 additions & 7 deletions app/lib/more/pages/more.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,30 @@ class DeleteDataDialog extends HookWidget {
children: [
DialogContentText(context.l10n.settings_page_delete_data_text),
SizedBox(height: PharMeTheme.mediumSpace),
CheckboxListTileWrapper(
isChecked: agreedToDeletion.value,
onChanged: (value) => agreedToDeletion.value = value
?? agreedToDeletion.value,
title: context.l10n.settings_page_delete_data_confirmation,
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.zero,
DialogContentText(
context.l10n.settings_page_delete_data_additional_text,
),
SizedBox(height: PharMeTheme.mediumSpace),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: PharMeTheme.mediumToLargeSpace,
height: PharMeTheme.mediumToLargeSpace,
child: Checkbox.adaptive(
value: agreedToDeletion.value,
onChanged: (value) =>
agreedToDeletion.value = value ?? agreedToDeletion.value,
),
),
SizedBox(width: PharMeTheme.smallSpace),
Expanded(
child: DialogContentText(
context.l10n.settings_page_delete_data_confirmation,
),
),
],
),
],
),
Expand Down

0 comments on commit 80615ea

Please sign in to comment.