Dark/bright: Auto (Android's dark theme), Dark or Bright, kept across restarts
/ crosscheck (push) Successful in 1s
CI / Analyze & Test (push) Successful in 19s
CI / Debug APK (push) Successful in 1m5s

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:
2026-10-15 22:14:29 +09:00
parent 0d0940e6b7
commit 78a6564f0a
8 changed files with 285 additions and 28 deletions
+31 -7
View File
@@ -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),