Disable value animation at start up % update FuelLevel path. 40/29440/3
authorLisandro Pérez Meyer <lpmeyer@ics.com>
Thu, 16 Nov 2023 18:42:22 +0000 (15:42 -0300)
committerLisandro Pérez Meyer <lpmeyer@ics.com>
Thu, 16 Nov 2023 18:47:49 +0000 (15:47 -0300)
Remove some warnings.

Original from: Dominik Wawrzonek <dwawrzonek@ics.com>

Bug-AGL: SPEC-4971

Change-Id: I3693fa74f7995b4dcb016812403ed800702cb81c
Signed-off-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
lib/core/constants/constants.dart
lib/core/constants/vss_path.dart
lib/data/data_providers/hybrid_notifier.dart
lib/data/data_providers/vehicle_notifier.dart
lib/data/models/vehicle.dart
lib/main.dart
lib/presentation/screens/apps/apps_content.dart
lib/presentation/screens/dashboard/widgets/circle_indicator.dart
lib/presentation/screens/splash/widget/splash_content.dart
pubspec.lock

index fe8d9f1..902af56 100644 (file)
@@ -4,7 +4,7 @@ const splashWarning =
     'Please use the IVI system responsibly while driving. Keep your attention on the road, and use voice commands or hands-free controls when interacting with the system. Distracted driving can lead to accidents and serious injury. Follow all traffic laws and drive safely.';
 const aglVeriosn = 'AGL 16.0.2 (pike)';
 const kernelVeriosn = 'Kernel: 5.10.41.-yocto-standard';
-const maxFuelLevel = 55.0;
+const maxFuelLevel = 100.0;
 const maxSpeed = 240.0;
 const maxRpm = 8000;
 final GlobalKey<ScaffoldState> homeScaffoldKey = GlobalKey();
index 8875d1e..92c036f 100644 (file)
@@ -5,7 +5,8 @@ class VSSPath {
   static const String vehicleOutsideTemperature =
       'Vehicle.Exterior.AirTemperature';
   static const String vehicleRange = 'Vehicle.Powertrain.FuelSystem.Range';
-  static const String vehicleFuelLevel = 'Vehicle.OBD.FuelLevel';
+  static const String vehicleFuelLevel =
+      'Vehicle.Powertrain.FuelSystem.RelativeLevel';
   static const String vehicleMediaVolume =
       'Vehicle.Cabin.Infotainment.Media.Volume';
   static const String vehicleIsChildLockActiveLeft =
index a19bf58..fd16a68 100644 (file)
@@ -1,3 +1,5 @@
+// ignore_for_file: unused_local_variable
+
 import '../../export.dart';
 
 class HybridNotifier extends StateNotifier<Hybrid> {
@@ -83,7 +85,7 @@ class HybridNotifier extends StateNotifier<Hybrid> {
     //   currentState = HybridState.baterryOutput;
     // }
 
-    // Zaktualizuj stan
+    // Update hybrid state
     if (currentState != previousState) {
       state = state.copyWith(hybridState: currentState);
     }
index 012e5dc..fb69595 100644 (file)
@@ -1,3 +1,5 @@
+// ignore_for_file: unused_local_variable
+
 import 'dart:async';
 
 import 'package:flutter_ics_homescreen/export.dart';
@@ -55,8 +57,8 @@ class VehicleNotifier extends StateNotifier<Vehicle> {
         }
         break;
       case VSSPath.vehicleFuelLevel:
-        if (update.entry.value.hasFloat()) {
-          state = state.copyWith(fuelLevel: update.entry.value.float);
+        if (update.entry.value.hasUint32()) {
+          state = state.copyWith(fuelLevel: update.entry.value.uint32);
         }
         break;
       // case VSSPath.vehicleMediaVolume:
@@ -290,7 +292,6 @@ class VehicleNotifier extends StateNotifier<Vehicle> {
       // });
     }
     try {
-      // ignore: unused_local_variable
       Map<String, String> metadata = {};
       //var responseStream = _stub.subscribe(request);
       stub.subscribe(request).listen((value) async {
@@ -434,11 +435,11 @@ class VehicleNotifier extends StateNotifier<Vehicle> {
       actualFuelLevel = actualFuelLevel + 1;
 
       if (actualFuelLevel > fuelLevel) {
-        actualFuelLevel = fuelLevel;
+        actualFuelLevel = fuelLevel.toDouble();
 
         timer.cancel();
       }
-      state = state.copyWith(fuelLevel: actualFuelLevel);
+      state = state.copyWith(fuelLevel: actualFuelLevel.toInt());
     });
     Timer outsideTemperatureTimer =
         Timer.periodic(const Duration(milliseconds: 300), (timer) {
index f27b750..adc6fc2 100644 (file)
@@ -8,7 +8,7 @@ class Vehicle {
   final double insideTemperature;
   final double outsideTemperature;
   final int range;
-  final double fuelLevel;
+  final int fuelLevel;
   final int mediaVolume;
   final bool isChildLockActiveLeft;
   final bool isChildLockActiveRight;
@@ -68,7 +68,7 @@ class Vehicle {
         insideTemperature = 25,
         outsideTemperature = 32.0,
         range = 21,
-        fuelLevel = 49.5,
+        fuelLevel = 49,
         mediaVolume = 50,
         isChildLockActiveLeft = false,
         isChildLockActiveRight = true,
@@ -88,7 +88,7 @@ class Vehicle {
       double? insideTemperature,
       double? outsideTemperature,
       int? range,
-      double? fuelLevel,
+      int? fuelLevel,
       int? mediaVolume,
       bool? isChildLockActiveLeft,
       bool? isChildLockActiveRight,
index 78795f4..3b896fc 100644 (file)
@@ -4,7 +4,6 @@ import 'export.dart';
 
 void main() async {
   WidgetsFlutterBinding.ensureInitialized();
-  // MediaKit.ensureInitialized(); //replace with lottie
   runApp(DevicePreview(
     enabled: false,
     tools: const [
index 52da10c..fe6e3b0 100644 (file)
@@ -1,4 +1,3 @@
-import 'package:flutter_ics_homescreen/data/models/hybrid.dart';
 import 'package:flutter_ics_homescreen/export.dart';
 import 'package:flutter_ics_homescreen/presentation/screens/apps/widgets/app_button.dart';
 
index 7a4e724..8fe9533 100644 (file)
@@ -285,7 +285,7 @@ class FuelProgressIndicatorState extends ConsumerState<FuelProgressIndicator>
                 width: 220,
                 child: CustomPaint(
                   foregroundPainter: CirclePainter(
-                      value: fuelLevel,
+                      value: fuelLevel.toDouble(),
                       maxValue: maxFuelLevel,
                       isFuel: true,
                       isRPM: false),
index 325baeb..991be84 100644 (file)
@@ -126,7 +126,7 @@ class SplashContentState extends ConsumerState<SplashContent>
           width: 452,
           text: 'Continue',
           onTap: () {
-            ref.read(vehicleProvider.notifier).setInitialState();
+            // ref.read(vehicleProvider.notifier).setInitialState();
             ref
                 .read(appProvider.notifier)
                 .update((state) => state = AppState.dashboard);
index 4645dd5..f78814f 100644 (file)
@@ -488,7 +488,7 @@ packages:
   protos:
     dependency: "direct main"
     description:
-      path: "./protos"
+      path: protos
       relative: true
     source: path
     version: "1.0.0"