Refactor preferences
This commit is contained in:
@@ -58,17 +58,17 @@ class GeneralSettingTiles extends HookConsumerWidget {
|
||||
SwitchListTile(
|
||||
title: Text(t.settings.general.autoIpCheck),
|
||||
secondary: const Icon(FluentIcons.globe_search_24_regular),
|
||||
value: ref.watch(autoCheckIpProvider),
|
||||
onChanged: ref.read(autoCheckIpProvider.notifier).update,
|
||||
value: ref.watch(Preferences.autoCheckIp),
|
||||
onChanged: ref.read(Preferences.autoCheckIp.notifier).update,
|
||||
),
|
||||
if (Platform.isAndroid) ...[
|
||||
SwitchListTile(
|
||||
title: Text(t.settings.general.dynamicNotification),
|
||||
secondary: const Icon(FluentIcons.top_speed_24_regular),
|
||||
value: ref.watch(dynamicNotificationProvider),
|
||||
value: ref.watch(Preferences.dynamicNotification),
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(dynamicNotificationProvider.notifier)
|
||||
.read(Preferences.dynamicNotification.notifier)
|
||||
.update(value);
|
||||
},
|
||||
),
|
||||
@@ -94,11 +94,9 @@ class GeneralSettingTiles extends HookConsumerWidget {
|
||||
),
|
||||
SwitchListTile(
|
||||
title: Text(t.settings.general.silentStart),
|
||||
value: ref.watch(silentStartNotifierProvider),
|
||||
value: ref.watch(Preferences.silentStart),
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(silentStartNotifierProvider.notifier)
|
||||
.update(value);
|
||||
await ref.read(Preferences.silentStart.notifier).update(value);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user