diff options
Diffstat (limited to 'lib/screen/widgets/right_bar.dart')
-rw-r--r-- | lib/screen/widgets/right_bar.dart | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/screen/widgets/right_bar.dart b/lib/screen/widgets/right_bar.dart index e5ed44d..a3d9ef4 100644 --- a/lib/screen/widgets/right_bar.dart +++ b/lib/screen/widgets/right_bar.dart @@ -4,8 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:flutter_cluster_dashboard/screen/paints/arc_painter.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_model.dart';
-import 'package:flutter_cluster_dashboard/vehicle_signal/vehicle_signal_provider.dart';
+import 'package:flutter_cluster_dashboard/vehicle-signals/vehicle_status_provider.dart';
class RightArc extends HookConsumerWidget {
final double screenHeight;
@@ -13,11 +12,11 @@ class RightArc extends HookConsumerWidget { @override
Widget build(BuildContext context, WidgetRef ref) {
- final VehicleSignal vehicle = ref.watch(vehicleSignalProvider);
+ final double fuelLevel = ref.watch(vehicleStatusProvider.select((p) => p.fuelLevel));
final animationController = useAnimationController(
lowerBound: 0,
upperBound: 100,
- )..animateTo(vehicle.fuelLevel,
+ )..animateTo(fuelLevel,
duration: const Duration(milliseconds: 500));
return AnimatedBuilder(
|