fix: errors

This commit is contained in:
Dr.Blank 2025-05-22 07:04:48 +05:30
parent dc0540467f
commit 32e2be4b95
No known key found for this signature in database
GPG key ID: BA5F87FF0560C57B

View file

@ -30,46 +30,56 @@ class ThemeSettingsPage extends HookConsumerWidget {
), ),
tiles: [ tiles: [
// choose system , light or dark theme // choose system , light or dark theme
Padding( SettingsTile(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), title: const Text('Theme Mode'),
child: SegmentedButton<ThemeMode>( description: Padding(
segments: [ padding: const EdgeInsets.only(top: 8.0),
ButtonSegment<ThemeMode>( child: SegmentedButton<ThemeMode>(
value: ThemeMode.light, segments: [
icon: Icon( ButtonSegment<ThemeMode>(
themeSettings.themeMode == ThemeMode.light value: ThemeMode.light,
? Icons.check icon: Icon(
: Icons.light_mode, themeSettings.themeMode == ThemeMode.light
? Icons.check
: Icons.light_mode,
),
label: const Text('Light'),
), ),
label: const Text('Light'), ButtonSegment<ThemeMode>(
), value: ThemeMode.system,
ButtonSegment<ThemeMode>( icon: Icon(
value: ThemeMode.system, themeSettings.themeMode == ThemeMode.system
icon: Icon( ? Icons.check
themeSettings.themeMode == ThemeMode.system : Icons.auto_awesome,
? Icons.check ),
: Icons.auto_awesome, label: const Text('System'),
), ),
label: const Text('System'), ButtonSegment<ThemeMode>(
), value: ThemeMode.dark,
ButtonSegment<ThemeMode>( icon: Icon(
value: ThemeMode.dark, themeSettings.themeMode == ThemeMode.dark
icon: Icon( ? Icons.check
themeSettings.themeMode == ThemeMode.dark : Icons.dark_mode,
? Icons.check ),
: Icons.dark_mode, label: const Text('Dark'),
), ),
label: const Text('Dark'), ],
), selected: {themeSettings.themeMode},
], onSelectionChanged: (Set<ThemeMode> newSelection) {
selected: {themeSettings.themeMode}, ref.read(appSettingsProvider.notifier).update(
onSelectionChanged: (Set<ThemeMode> newSelection) { appSettings.copyWith.themeSettings(
ref.read(appSettingsProvider.notifier).update( themeMode: newSelection.first,
appSettings.copyWith.themeSettings( ),
themeMode: newSelection.first, );
), },
); ),
}, ),
leading: Icon(
themeSettings.themeMode == ThemeMode.light
? Icons.light_mode
: themeSettings.themeMode == ThemeMode.dark
? Icons.dark_mode
: Icons.auto_awesome,
), ),
), ),