Status bar: the Orin at a glance over every view, like a phone's
Link on the left (with the menu on the Dash), then hot temperature, CAN, OBD while connected, GNSS fix and satellites, LTE, WiFi, UPS, and the dark/bright button. The Dash's own top line is gone into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-46
@@ -6,7 +6,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../link/boundary.dart';
|
||||
import '../shell_scope.dart';
|
||||
import '../link/reading.dart';
|
||||
import '../theme/palette.dart';
|
||||
import '../widgets/accel_graph.dart';
|
||||
@@ -16,14 +15,13 @@ import '../widgets/telltale.dart';
|
||||
import '../widgets/whiskey_mark.dart';
|
||||
|
||||
class DashPage extends StatelessWidget {
|
||||
const DashPage({super.key, required this.boundary, required this.themes});
|
||||
const DashPage({super.key, required this.boundary});
|
||||
final Boundary boundary;
|
||||
final Themes themes;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListenableBuilder(
|
||||
listenable: Listenable.merge([boundary, themes]),
|
||||
listenable: boundary,
|
||||
builder: (context, _) {
|
||||
final p = AppTheme.of(context);
|
||||
final b = boundary;
|
||||
@@ -50,7 +48,6 @@ class DashPage extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_DashBar(boundary: b, themes: themes),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
@@ -163,44 +160,3 @@ class DashPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 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;
|
||||
final Themes themes;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final p = AppTheme.of(context);
|
||||
final (text, color) = switch (boundary.state) {
|
||||
LinkState.up => ('LINK', p.subdued),
|
||||
LinkState.connecting => ('CONNECTING', p.caution),
|
||||
LinkState.down => ('NO LINK', p.alarm),
|
||||
};
|
||||
return SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
children: [
|
||||
MenuButton(color: p.subdued),
|
||||
Text(text, style: TextStyle(color: color, letterSpacing: 2)),
|
||||
const Spacer(),
|
||||
// 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