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
+13 -7
View File
@@ -164,7 +164,7 @@ class DashPage extends StatelessWidget {
}
}
/// The dash's own thin top line: the menu, link state, and the dark/bright switch.
/// The dash's own thin top line: the menu, link state, and the dark/bright quick switch.
class _DashBar extends StatelessWidget {
const _DashBar({required this.boundary, required this.themes});
final Boundary boundary;
@@ -185,12 +185,18 @@ class _DashBar extends StatelessWidget {
MenuButton(color: p.subdued),
Text(text, style: TextStyle(color: color, letterSpacing: 2)),
const Spacer(),
IconButton(
tooltip: themes.isDark ? 'Bright' : 'Dark',
onPressed: themes.toggle,
icon: Icon(
themes.isDark ? Icons.light_mode : Icons.dark_mode,
color: p.subdued,
// Tap: hold the other variant. Long press: back to auto (Settings has both).
GestureDetector(
onLongPress: () => themes.mode = VariantMode.auto,
child: IconButton(
tooltip: themes.isDark ? 'Bright' : 'Dark',
onPressed: themes.toggle,
icon: Icon(
themes.mode == VariantMode.auto
? Icons.brightness_auto
: (themes.isDark ? Icons.light_mode : Icons.dark_mode),
color: p.subdued,
),
),
),
],