Dash: indicator telltales as Material triangle icons (◀▶ stay emoji on Android even with U+FE0E)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
This commit is contained in:
+18
-2
@@ -140,11 +140,13 @@ class DashPage extends StatelessWidget {
|
||||
isWarning: () => (coolant.number ?? 0) > 105,
|
||||
),
|
||||
Telltale(
|
||||
label: '◀\uFE0E',
|
||||
label: 'LEFT',
|
||||
icon: Icons.arrow_left,
|
||||
reading: r('indicator_left'),
|
||||
),
|
||||
Telltale(
|
||||
label: '▶\uFE0E',
|
||||
label: 'RIGHT',
|
||||
icon: Icons.arrow_right,
|
||||
reading: r('indicator_right'),
|
||||
),
|
||||
Telltale(
|
||||
@@ -188,11 +190,15 @@ class Telltale extends StatelessWidget {
|
||||
super.key,
|
||||
required this.label,
|
||||
required this.reading,
|
||||
this.icon,
|
||||
this.warn = false,
|
||||
this.flex = 1,
|
||||
});
|
||||
|
||||
final String label;
|
||||
|
||||
/// Drawn instead of the label when set. Glyphs like ◀ ▶ come out as emoji on Android.
|
||||
final IconData? icon;
|
||||
final Reading reading;
|
||||
final bool warn;
|
||||
final int flex;
|
||||
@@ -210,6 +216,16 @@ class Telltale extends StatelessWidget {
|
||||
child: LayoutBuilder(
|
||||
builder: (context, c) {
|
||||
final size = c.maxHeight * 0.3;
|
||||
if (icon != null && !missing) {
|
||||
return Center(
|
||||
child: Icon(
|
||||
icon,
|
||||
size: c.maxHeight * 0.7,
|
||||
color: color,
|
||||
semanticLabel: label,
|
||||
),
|
||||
);
|
||||
}
|
||||
return Center(
|
||||
child: Text(
|
||||
missing ? '—' : label,
|
||||
|
||||
Reference in New Issue
Block a user