Update theme settings in app_settings_provider.dart

This commit is contained in:
Dr-Blank 2024-08-20 11:39:26 -04:00
parent 8d71020436
commit 74e0d77cf9
No known key found for this signature in database
GPG key ID: 7452CC63F210A266
10 changed files with 239 additions and 65 deletions

View file

@ -44,10 +44,10 @@ class AppSettingsPage extends HookConsumerWidget {
),
tiles: [
SettingsTile.switchTile(
initialValue: appSettings.isDarkMode,
initialValue: appSettings.themeSettings.isDarkMode,
title: const Text('Dark Mode'),
description: const Text('we all know dark mode is better'),
leading: appSettings.isDarkMode
leading: appSettings.themeSettings.isDarkMode
? const Icon(Icons.dark_mode)
: const Icon(Icons.light_mode),
onToggle: (value) {
@ -55,17 +55,18 @@ class AppSettingsPage extends HookConsumerWidget {
},
),
SettingsTile.switchTile(
initialValue: appSettings.useMaterialThemeOnItemPage,
initialValue:
appSettings.themeSettings.useMaterialThemeOnItemPage,
title: const Text('Adaptive Theme on Item Page'),
description: const Text(
'get fancy with the colors on the item page at the cost of some performance',
),
leading: appSettings.useMaterialThemeOnItemPage
leading: appSettings.themeSettings.useMaterialThemeOnItemPage
? const Icon(Icons.auto_fix_high)
: const Icon(Icons.auto_fix_off),
onToggle: (value) {
ref.read(appSettingsProvider.notifier).updateState(
appSettings.copyWith(
appSettings.copyWith.themeSettings(
useMaterialThemeOnItemPage: value,
),
);