mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 18:22:39 +03:00
Match style of desktop settings page with Android page.
This commit is contained in:
parent
f02781b6b6
commit
32076aee51
@ -15,41 +15,52 @@ class SettingsPage extends ConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final themeMode = ref.watch(themeModeProvider);
|
final themeMode = ref.watch(themeModeProvider);
|
||||||
|
|
||||||
|
final theme = Theme.of(context);
|
||||||
return ResponsiveDialog(
|
return ResponsiveDialog(
|
||||||
title: const Text('Settings'),
|
title: const Text('Settings'),
|
||||||
child: Column(
|
child: Theme(
|
||||||
mainAxisSize: MainAxisSize.min,
|
// Make the headers use the primary color to pop a bit.
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// Once M3 is implemented this will probably not be needed.
|
||||||
children: [
|
data: theme.copyWith(
|
||||||
const ListTitle('Appearance'),
|
textTheme: theme.textTheme.copyWith(
|
||||||
RadioListTile<ThemeMode>(
|
labelLarge: theme.textTheme.labelLarge
|
||||||
title: const Text('System default'),
|
?.copyWith(color: theme.colorScheme.primary)),
|
||||||
value: ThemeMode.system,
|
),
|
||||||
groupValue: themeMode,
|
child: Column(
|
||||||
onChanged: (mode) {
|
mainAxisSize: MainAxisSize.min,
|
||||||
ref.read(themeModeProvider.notifier).setThemeMode(mode!);
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
_log.debug('Set theme mode to $mode');
|
children: [
|
||||||
},
|
const ListTitle('Appearance'),
|
||||||
),
|
RadioListTile<ThemeMode>(
|
||||||
RadioListTile<ThemeMode>(
|
title: const Text('System default'),
|
||||||
title: const Text('Light mode'),
|
value: ThemeMode.system,
|
||||||
value: ThemeMode.light,
|
groupValue: themeMode,
|
||||||
groupValue: themeMode,
|
onChanged: (mode) {
|
||||||
onChanged: (mode) {
|
ref.read(themeModeProvider.notifier).setThemeMode(mode!);
|
||||||
ref.read(themeModeProvider.notifier).setThemeMode(mode!);
|
_log.debug('Set theme mode to $mode');
|
||||||
_log.debug('Set theme mode to $mode');
|
},
|
||||||
},
|
),
|
||||||
),
|
RadioListTile<ThemeMode>(
|
||||||
RadioListTile<ThemeMode>(
|
title: const Text('Light mode'),
|
||||||
title: const Text('Dark mode'),
|
value: ThemeMode.light,
|
||||||
value: ThemeMode.dark,
|
groupValue: themeMode,
|
||||||
groupValue: themeMode,
|
onChanged: (mode) {
|
||||||
onChanged: (mode) {
|
ref.read(themeModeProvider.notifier).setThemeMode(mode!);
|
||||||
ref.read(themeModeProvider.notifier).setThemeMode(mode!);
|
_log.debug('Set theme mode to $mode');
|
||||||
_log.debug('Set theme mode to $mode');
|
},
|
||||||
},
|
),
|
||||||
),
|
RadioListTile<ThemeMode>(
|
||||||
],
|
title: const Text('Dark mode'),
|
||||||
|
value: ThemeMode.dark,
|
||||||
|
groupValue: themeMode,
|
||||||
|
onChanged: (mode) {
|
||||||
|
ref.read(themeModeProvider.notifier).setThemeMode(mode!);
|
||||||
|
_log.debug('Set theme mode to $mode');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user