Re-arrange settings

This commit is contained in:
Ashita Prasad
2024-12-21 17:30:12 +05:30
parent 1df49bd727
commit 21f8e34212

View File

@ -40,21 +40,6 @@ class SettingsPage extends ConsumerWidget {
child: ListView(
shrinkWrap: true,
children: [
!kIsWeb
? SwitchListTile(
hoverColor: kColorTransparent,
title: const Text('Disable SSL verification'),
subtitle: Text(
'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}',
),
value: settings.isSSLDisabled,
onChanged: (bool? value) {
ref
.read(settingsProvider.notifier)
.update(isSSLDisabled: value ?? false);
},
)
: kSizedBoxEmpty,
SwitchListTile(
hoverColor: kColorTransparent,
title: const Text('Switch Theme Mode'),
@ -91,6 +76,21 @@ class SettingsPage extends ConsumerWidget {
},
),
),
!kIsWeb
? SwitchListTile(
hoverColor: kColorTransparent,
title: const Text('Disable SSL verification'),
subtitle: Text(
'Current selection: ${settings.isSSLDisabled ? "SSL Verification Disabled" : "SSL Verification Enabled"}',
),
value: settings.isSSLDisabled,
onChanged: (bool? value) {
ref
.read(settingsProvider.notifier)
.update(isSSLDisabled: value ?? false);
},
)
: kSizedBoxEmpty,
ListTile(
hoverColor: kColorTransparent,
title: const Text('Default Code Generator'),
@ -125,6 +125,20 @@ class SettingsPage extends ConsumerWidget {
.update(promptBeforeClosing: value);
},
),
ListTile(
hoverColor: kColorTransparent,
title: const Text('History Retention Period'),
subtitle: Text(
'Your request history will be retained${settings.historyRetentionPeriod == HistoryRetentionPeriod.forever ? "" : " for"} ${settings.historyRetentionPeriod.label}'),
trailing: HistoryRetentionPopupMenu(
value: settings.historyRetentionPeriod,
onChanged: (value) {
ref
.read(settingsProvider.notifier)
.update(historyRetentionPeriod: value);
},
),
),
ListTile(
hoverColor: kColorTransparent,
title: const Text('Export Data'),
@ -144,20 +158,6 @@ class SettingsPage extends ConsumerWidget {
),
),
),
ListTile(
hoverColor: kColorTransparent,
title: const Text('History Retention Period'),
subtitle: Text(
'Your request history will be retained${settings.historyRetentionPeriod == HistoryRetentionPeriod.forever ? "" : " for"} ${settings.historyRetentionPeriod.label}'),
trailing: HistoryRetentionPopupMenu(
value: settings.historyRetentionPeriod,
onChanged: (value) {
ref
.read(settingsProvider.notifier)
.update(historyRetentionPeriod: value);
},
),
),
ListTile(
hoverColor: kColorTransparent,
title: const Text('Clear Data'),