Skip to content

Commit

Permalink
refactor: move exporting patches to another section
Browse files Browse the repository at this point in the history
  • Loading branch information
Aunali321 committed Nov 9, 2022
1 parent c571cf2 commit d545dfe
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 29 deletions.
1 change: 1 addition & 0 deletions assets/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
65 changes: 36 additions & 29 deletions lib/ui/views/settings/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -187,9 +187,9 @@ class SettingsView extends StatelessWidget {
),
ListTile(
contentPadding:
const EdgeInsets.symmetric(horizontal: 20.0),
const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.exportPatchesLabel',
'settingsView.deleteLogsLabel',
child: const Text(
'',
style: TextStyle(
Expand All @@ -198,14 +198,20 @@ class SettingsView extends StatelessWidget {
),
),
),
subtitle: I18nText('settingsView.exportPatchesHint'),
onTap: () => model.exportPatches(),
subtitle: I18nText('settingsView.deleteLogsHint'),
onTap: () => model.deleteLogs(),
),
],
),
_settingsDivider,
SettingsSection(
title: 'settingsView.exportSectionTitle',
children: <Widget>[
ListTile(
contentPadding:
const EdgeInsets.symmetric(horizontal: 20.0),
const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.importPatchesLabel',
'settingsView.exportPatchesLabel',
child: const Text(
'',
style: TextStyle(
Expand All @@ -214,14 +220,14 @@ class SettingsView extends StatelessWidget {
),
),
),
subtitle: I18nText('settingsView.importPatchesHint'),
onTap: () => model.importPatches(),
subtitle: I18nText('settingsView.exportPatchesHint'),
onTap: () => model.exportPatches(),
),
ListTile(
contentPadding:
const EdgeInsets.symmetric(horizontal: 20.0),
const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.resetStoredPatchesLabel',
'settingsView.importPatchesLabel',
child: const Text(
'',
style: TextStyle(
Expand All @@ -230,14 +236,14 @@ class SettingsView extends StatelessWidget {
),
),
),
subtitle: I18nText('settingsView.resetStoredPatchesHint'),
onTap: () => model.resetSelectedPatches(),
subtitle: I18nText('settingsView.importPatchesHint'),
onTap: () => model.importPatches(),
),
ListTile(
contentPadding:
const EdgeInsets.symmetric(horizontal: 20.0),
title: I18nText(
'settingsView.deleteLogsLabel',
'settingsView.resetStoredPatchesLabel',
child: const Text(
'',
style: TextStyle(
Expand All @@ -246,8 +252,9 @@ class SettingsView extends StatelessWidget {
),
),
),
subtitle: I18nText('settingsView.deleteLogsHint'),
onTap: () => model.deleteLogs(),
subtitle:
I18nText('settingsView.resetStoredPatchesHint'),
onTap: () => model.resetSelectedPatches(),
),
],
),
Expand Down

0 comments on commit d545dfe

Please sign in to comment.