aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/core/constants/constants.dart2
-rw-r--r--lib/core/constants/vss_path.dart3
-rw-r--r--lib/data/data_providers/hybrid_notifier.dart4
-rw-r--r--lib/data/data_providers/vehicle_notifier.dart11
-rw-r--r--lib/data/models/vehicle.dart6
-rw-r--r--lib/main.dart1
-rw-r--r--lib/presentation/screens/apps/apps_content.dart1
-rw-r--r--lib/presentation/screens/dashboard/widgets/circle_indicator.dart2
-rw-r--r--lib/presentation/screens/splash/widget/splash_content.dart2
-rw-r--r--pubspec.lock2
10 files changed, 18 insertions, 16 deletions
diff --git a/lib/core/constants/constants.dart b/lib/core/constants/constants.dart
index fe8d9f1..902af56 100644
--- a/lib/core/constants/constants.dart
+++ b/lib/core/constants/constants.dart
@@ -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();
diff --git a/lib/core/constants/vss_path.dart b/lib/core/constants/vss_path.dart
index 8875d1e..92c036f 100644
--- a/lib/core/constants/vss_path.dart
+++ b/lib/core/constants/vss_path.dart
@@ -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 =
diff --git a/lib/data/data_providers/hybrid_notifier.dart b/lib/data/data_providers/hybrid_notifier.dart
index a19bf58..fd16a68 100644
--- a/lib/data/data_providers/hybrid_notifier.dart
+++ b/lib/data/data_providers/hybrid_notifier.dart
@@ -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);
}
diff --git a/lib/data/data_providers/vehicle_notifier.dart b/lib/data/data_providers/vehicle_notifier.dart
index 012e5dc..fb69595 100644
--- a/lib/data/data_providers/vehicle_notifier.dart
+++ b/lib/data/data_providers/vehicle_notifier.dart
@@ -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) {
diff --git a/lib/data/models/vehicle.dart b/lib/data/models/vehicle.dart
index f27b750..adc6fc2 100644
--- a/lib/data/models/vehicle.dart
+++ b/lib/data/models/vehicle.dart
@@ -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,
diff --git a/lib/main.dart b/lib/main.dart
index 78795f4..3b896fc 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -4,7 +4,6 @@ import 'export.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
- // MediaKit.ensureInitialized(); //replace with lottie
runApp(DevicePreview(
enabled: false,
tools: const [
diff --git a/lib/presentation/screens/apps/apps_content.dart b/lib/presentation/screens/apps/apps_content.dart
index 52da10c..fe6e3b0 100644
--- a/lib/presentation/screens/apps/apps_content.dart
+++ b/lib/presentation/screens/apps/apps_content.dart
@@ -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';
diff --git a/lib/presentation/screens/dashboard/widgets/circle_indicator.dart b/lib/presentation/screens/dashboard/widgets/circle_indicator.dart
index 7a4e724..8fe9533 100644
--- a/lib/presentation/screens/dashboard/widgets/circle_indicator.dart
+++ b/lib/presentation/screens/dashboard/widgets/circle_indicator.dart
@@ -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),
diff --git a/lib/presentation/screens/splash/widget/splash_content.dart b/lib/presentation/screens/splash/widget/splash_content.dart
index 325baeb..991be84 100644
--- a/lib/presentation/screens/splash/widget/splash_content.dart
+++ b/lib/presentation/screens/splash/widget/splash_content.dart
@@ -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);
diff --git a/pubspec.lock b/pubspec.lock
index 4645dd5..f78814f 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -488,7 +488,7 @@ packages:
protos:
dependency: "direct main"
description:
- path: "./protos"
+ path: protos
relative: true
source: path
version: "1.0.0"