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,
|
isWarning: () => (coolant.number ?? 0) > 105,
|
||||||
),
|
),
|
||||||
Telltale(
|
Telltale(
|
||||||
label: '◀\uFE0E',
|
label: 'LEFT',
|
||||||
|
icon: Icons.arrow_left,
|
||||||
reading: r('indicator_left'),
|
reading: r('indicator_left'),
|
||||||
),
|
),
|
||||||
Telltale(
|
Telltale(
|
||||||
label: '▶\uFE0E',
|
label: 'RIGHT',
|
||||||
|
icon: Icons.arrow_right,
|
||||||
reading: r('indicator_right'),
|
reading: r('indicator_right'),
|
||||||
),
|
),
|
||||||
Telltale(
|
Telltale(
|
||||||
@@ -188,11 +190,15 @@ class Telltale extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.reading,
|
required this.reading,
|
||||||
|
this.icon,
|
||||||
this.warn = false,
|
this.warn = false,
|
||||||
this.flex = 1,
|
this.flex = 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String label;
|
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 Reading reading;
|
||||||
final bool warn;
|
final bool warn;
|
||||||
final int flex;
|
final int flex;
|
||||||
@@ -210,6 +216,16 @@ class Telltale extends StatelessWidget {
|
|||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
builder: (context, c) {
|
builder: (context, c) {
|
||||||
final size = c.maxHeight * 0.3;
|
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(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
missing ? '—' : label,
|
missing ? '—' : label,
|
||||||
|
|||||||
Reference in New Issue
Block a user