From 4a6dd91a1e1c7821eae1668449885a8c04825071 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 15 Aug 2024 15:50:02 -0400 Subject: Fix engine speed signal type Update use of the VSS engine speed (RPM) signal to match the fix done to the AGL VSS overlays to restore the upstream integer data type. Bug-AGL: SPEC-5204 Change-Id: I22bd80817088a67a2f62dab129920e19c949846a Signed-off-by: Scott Murray --- lib/screen/widgets/gauges/rpm_gauge_animation_wrapper.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/screen/widgets') diff --git a/lib/screen/widgets/gauges/rpm_gauge_animation_wrapper.dart b/lib/screen/widgets/gauges/rpm_gauge_animation_wrapper.dart index fa76bd8..b110a1a 100644 --- a/lib/screen/widgets/gauges/rpm_gauge_animation_wrapper.dart +++ b/lib/screen/widgets/gauges/rpm_gauge_animation_wrapper.dart @@ -16,7 +16,7 @@ class RPMGauge extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final double rpm = ref.watch(vehicleStatusProvider.select((p) => p.rpm)); + final int rpm = ref.watch(vehicleStatusProvider.select((p) => p.rpm)); const double minRPM = 0; const double maxRPM = 8000; @@ -25,7 +25,7 @@ class RPMGauge extends HookConsumerWidget { final animationController = useAnimationController( lowerBound: minRPM, upperBound: maxRPM, - )..animateTo(rpm, + )..animateTo(rpm.toDouble(), duration: sweepDuration, curve: Curves.linearToEaseOut); return AnimatedBuilder( animation: animationController, @@ -38,8 +38,8 @@ class RPMGauge extends HookConsumerWidget { high: maxRPM, mainValue: animationController.value, label: "rpm", - zeroTickLabel: minRPM.toInt().toString(), - maxTickLabel: maxRPM.toInt().toString(), + zeroTickLabel: minRPM.toString(), + maxTickLabel: maxRPM.toString(), inPrimaryColor: gaugeColor?.inPrimary, outPrimaryColor: gaugeColor?.outPrimary, secondaryColor: gaugeColor?.secondary, -- cgit