Dark/bright: Auto (Android's dark theme), Dark or Bright, kept across restarts
Settings has a segmented Auto / Dark / Bright. Auto follows platformBrightness, so Android's schedule too. The Dash's quick button holds the other variant; a long press is auto again. The mode is kept with shared_preferences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+31
-7
@@ -52,14 +52,38 @@ class SettingsPage extends StatelessWidget {
|
||||
onTap: () => editUrl(context, boundary, usb),
|
||||
),
|
||||
section('Display'),
|
||||
SwitchListTile(
|
||||
secondary: Icon(
|
||||
themes.isDark ? Icons.dark_mode : Icons.light_mode,
|
||||
ListTile(
|
||||
leading: Icon(themes.isDark ? Icons.dark_mode : Icons.light_mode),
|
||||
title: const Text('Dark or bright'),
|
||||
subtitle: const Text(
|
||||
"Auto follows Android's dark theme and its schedule. "
|
||||
"The Dash's button holds one; a long press there is auto again.",
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(72, 0, 16, 8),
|
||||
child: SegmentedButton<VariantMode>(
|
||||
segments: const [
|
||||
ButtonSegment(
|
||||
value: VariantMode.auto,
|
||||
icon: Icon(Icons.brightness_auto),
|
||||
label: Text('Auto'),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: VariantMode.dark,
|
||||
icon: Icon(Icons.dark_mode),
|
||||
label: Text('Dark'),
|
||||
),
|
||||
ButtonSegment(
|
||||
value: VariantMode.bright,
|
||||
icon: Icon(Icons.light_mode),
|
||||
label: Text('Bright'),
|
||||
),
|
||||
],
|
||||
selected: {themes.mode},
|
||||
showSelectedIcon: false,
|
||||
onSelectionChanged: (s) => themes.mode = s.single,
|
||||
),
|
||||
title: const Text('Dark variant'),
|
||||
subtitle: const Text('Bright for daylight, dark for night'),
|
||||
value: themes.isDark,
|
||||
onChanged: (v) => themes.isDark = v,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.palette),
|
||||
|
||||
Reference in New Issue
Block a user