From d545dfe49b5db666d4f9ee293ad4e7c69078c254 Mon Sep 17 00:00:00 2001 From: Aunali321 Date: Wed, 9 Nov 2022 14:20:32 +0530 Subject: [PATCH] refactor: move exporting patches to another section --- assets/i18n/en_US.json | 1 + lib/ui/views/settings/settings_view.dart | 75 +++++++++++++----------- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json index 094c7461..0d8ea340 100644 --- a/assets/i18n/en_US.json +++ b/assets/i18n/en_US.json @@ -139,6 +139,7 @@ "experimentalPatchesLabel": "Experimental Patch support", "experimentalPatchesHint": "Enable to use unsupported patches in any app version", "enabledExperimentalPatches": "Experimental patches enabled", + "exportSectionTitle": "Import/Export", "aboutLabel": "About", "snackbarMessage": "Copied to clipboard", "sentryLabel": "Sentry Logging", diff --git a/lib/ui/views/settings/settings_view.dart b/lib/ui/views/settings/settings_view.dart index 79c0aac7..96a74e82 100644 --- a/lib/ui/views/settings/settings_view.dart +++ b/lib/ui/views/settings/settings_view.dart @@ -137,22 +137,22 @@ class SettingsView extends StatelessWidget { onTap: () => model.showSourcesDialog(context), ), CustomSwitchTile( - padding: const EdgeInsets.symmetric(horizontal: 20.0), - title: I18nText( - 'settingsView.experimentalPatchesLabel', - child: const Text( - '', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w500, - ), + padding: const EdgeInsets.symmetric(horizontal: 20.0), + title: I18nText( + 'settingsView.experimentalPatchesLabel', + child: const Text( + '', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w500, ), ), - subtitle: - I18nText('settingsView.experimentalPatchesHint'), - value: model.areExperimentalPatchesEnabled(), - onTap: (value) => - model.useExperimentalPatches(value)), + ), + subtitle: + I18nText('settingsView.experimentalPatchesHint'), + value: model.areExperimentalPatchesEnabled(), + onTap: (value) => model.useExperimentalPatches(value), + ), ListTile( contentPadding: const EdgeInsets.symmetric(horizontal: 20.0), @@ -187,7 +187,29 @@ class SettingsView extends StatelessWidget { ), ListTile( contentPadding: - const EdgeInsets.symmetric(horizontal: 20.0), + const EdgeInsets.symmetric(horizontal: 20.0), + title: I18nText( + 'settingsView.deleteLogsLabel', + child: const Text( + '', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w500, + ), + ), + ), + subtitle: I18nText('settingsView.deleteLogsHint'), + onTap: () => model.deleteLogs(), + ), + ], + ), + _settingsDivider, + SettingsSection( + title: 'settingsView.exportSectionTitle', + children: [ + ListTile( + contentPadding: + const EdgeInsets.symmetric(horizontal: 20.0), title: I18nText( 'settingsView.exportPatchesLabel', child: const Text( @@ -203,7 +225,7 @@ class SettingsView extends StatelessWidget { ), ListTile( contentPadding: - const EdgeInsets.symmetric(horizontal: 20.0), + const EdgeInsets.symmetric(horizontal: 20.0), title: I18nText( 'settingsView.importPatchesLabel', child: const Text( @@ -219,7 +241,7 @@ class SettingsView extends StatelessWidget { ), ListTile( contentPadding: - const EdgeInsets.symmetric(horizontal: 20.0), + const EdgeInsets.symmetric(horizontal: 20.0), title: I18nText( 'settingsView.resetStoredPatchesLabel', child: const Text( @@ -230,25 +252,10 @@ class SettingsView extends StatelessWidget { ), ), ), - subtitle: I18nText('settingsView.resetStoredPatchesHint'), + subtitle: + I18nText('settingsView.resetStoredPatchesHint'), onTap: () => model.resetSelectedPatches(), ), - ListTile( - contentPadding: - const EdgeInsets.symmetric(horizontal: 20.0), - title: I18nText( - 'settingsView.deleteLogsLabel', - child: const Text( - '', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w500, - ), - ), - ), - subtitle: I18nText('settingsView.deleteLogsHint'), - onTap: () => model.deleteLogs(), - ), ], ), _settingsDivider,