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:
+13
-7
@@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user