summaryrefslogtreecommitdiffstats
path: root/lib/screen/home.dart
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2024-01-05 18:50:51 -0500
committerScott Murray <scott.murray@konsulko.com>2024-01-05 18:52:32 -0500
commitdbb971abeaa2beff2a13e421f8cca83b3054db34 (patch)
tree049af6bf56c53534807f6cb5de9803dcb111c4e6 /lib/screen/home.dart
parentda47b0611f7495fb9f4727449721c18c9a617217 (diff)
Fix unit handling
Fix distance unit handling with respect to the VSS signal for that, and add temperature unit support. Bug-AGL: SPEC-5045 Change-Id: I9b25c36c36d19da55f1b9bff7f380c55d592d5d6 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'lib/screen/home.dart')
-rw-r--r--lib/screen/home.dart15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/screen/home.dart b/lib/screen/home.dart
index f154550..d9bfa32 100644
--- a/lib/screen/home.dart
+++ b/lib/screen/home.dart
@@ -67,6 +67,15 @@ class _HomeState extends ConsumerState<Home> {
final String performanceMode = ref.watch(vehicleStatusProvider.select((p) => p.performanceMode));
final String selectedGear = ref.watch(vehicleStatusProvider.select((p) => p.selectedGear));
final double ambientAirTemp = ref.watch(vehicleStatusProvider.select((p) => p.ambientAirTemp));
+ final TemperatureUnit tempUnit = ref.watch(vehicleStatusProvider.select((p) => p.temperatureUnit));
+
+ String ambientAirTempString = "";
+ if (tempUnit == TemperatureUnit.celsius) {
+ ambientAirTempString += "${ambientAirTemp.toStringAsFixed(0)} ${"\u00B0"}C";
+ } else {
+ ambientAirTempString += "${((ambientAirTemp * 9 / 5) + 32).toStringAsFixed(0)} ${"\u00B0"}F";
+ }
+
final clock = ref.watch(clockProvider);
final windowHeight = MediaQuery.of(context).size.height;
final windowWidth = MediaQuery.of(context).size.width;
@@ -105,8 +114,8 @@ class _HomeState extends ConsumerState<Home> {
children: [
TurnSignal(
screenHeight: screenHeight,
- isLefton: isLeftIndicator,
- isRighton: isRightIndicator,
+ isLeftOn: isLeftIndicator,
+ isRightOn: isRightIndicator,
),
Flex(
direction: Axis.horizontal,
@@ -146,7 +155,7 @@ class _HomeState extends ConsumerState<Home> {
SizedBox(
width: (30 * screenHeight) / 480),
Text(
- "${ambientAirTemp} ${"\u00B0"}C",
+ ambientAirTempString,
style: TextStyle(
color: const Color.fromARGB(
255, 184, 183, 183),