summaryrefslogtreecommitdiffstats
path: root/lib/data/models
diff options
context:
space:
mode:
authorLisandro Pérez Meyer <lpmeyer@ics.com>2023-11-17 09:17:29 -0300
committerLisandro Perez Meyer <lpmeyer@ics.com>2023-11-17 14:11:43 +0000
commit0016d533a9fc601aa65f69a050c60c8d6158ed36 (patch)
tree6fd0765f9d1006a2bddd142caf1d7c0a9d5482cf /lib/data/models
parent4d77bab5a0f698943d1abf74482eecef7cc95f08 (diff)
Disable value animation at start up % update FuelLevel path.
Also: - Remove some warnings. - Improvements of hvac temp buttons. Original from: Dominik Wawrzonek <dwawrzonek@ics.com> Bug-AGL: SPEC-4971 Change-Id: Ic10e9ec5ec79f79f63d951469924325f29ea3fa7 Signed-off-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
Diffstat (limited to 'lib/data/models')
-rw-r--r--lib/data/models/vehicle.dart41
1 files changed, 32 insertions, 9 deletions
diff --git a/lib/data/models/vehicle.dart b/lib/data/models/vehicle.dart
index adc6fc2..16752d3 100644
--- a/lib/data/models/vehicle.dart
+++ b/lib/data/models/vehicle.dart
@@ -22,6 +22,8 @@ class Vehicle {
final bool isRearDefrosterActive;
final bool isRecirculationActive;
final int fanSpeed;
+ final int driverTemperature;
+ final int passengerTemperature;
const Vehicle(
this.speed,
@@ -41,7 +43,10 @@ class Vehicle {
this.isFrontDefrosterActive,
this.isRearDefrosterActive,
this.isRecirculationActive,
- this.fanSpeed);
+ this.fanSpeed,
+ this.driverTemperature,
+ this.passengerTemperature,
+ );
const Vehicle.initial()
: speed = 0,
@@ -61,7 +66,9 @@ class Vehicle {
isFrontDefrosterActive = false,
isRearDefrosterActive = false,
isRecirculationActive = false,
- fanSpeed = 0;
+ fanSpeed = 0,
+ driverTemperature = 26,
+ passengerTemperature = 26;
const Vehicle.initialForDebug()
: speed = 60,
@@ -81,7 +88,9 @@ class Vehicle {
isFrontDefrosterActive = false,
isRearDefrosterActive = false,
isRecirculationActive = false,
- fanSpeed = 0;
+ fanSpeed = 0,
+ driverTemperature = 26,
+ passengerTemperature = 26;
Vehicle copyWith(
{double? speed,
@@ -101,7 +110,10 @@ class Vehicle {
bool? isFrontDefrosterActive,
bool? isRearDefrosterActive,
bool? isRecirculationActive,
- int? fanSpeed}) {
+ int? fanSpeed,
+ int? driverTemperature,
+ int? passengerTemperature,
+ }) {
return Vehicle(
speed ?? this.speed,
insideTemperature ?? this.insideTemperature,
@@ -120,7 +132,10 @@ class Vehicle {
isFrontDefrosterActive ?? this.isFrontDefrosterActive,
isRearDefrosterActive ?? this.isRearDefrosterActive,
isRecirculationActive ?? this.isRecirculationActive,
- fanSpeed ?? this.fanSpeed);
+ fanSpeed ?? this.fanSpeed,
+ driverTemperature ?? this.driverTemperature,
+ passengerTemperature ?? this.passengerTemperature,
+ );
}
Map<String, dynamic> toMap() {
@@ -142,7 +157,9 @@ class Vehicle {
'isFrontDefrosterActive': isFrontDefrosterActive,
'isRearDefrosterActive': isRearDefrosterActive,
'isRecirculationActive': isRecirculationActive,
- 'fanSpeed': fanSpeed
+ 'fanSpeed': fanSpeed,
+ 'driverTemperature': driverTemperature,
+ 'passengerTemperature': passengerTemperature,
};
}
@@ -166,6 +183,8 @@ class Vehicle {
map['isRearDefrosterActive'] ?? false,
map['isRecirculationActive'] ?? false,
map['fanSpeed'] ?? 0,
+ map['driverTemperature'] ?? 0,
+ map['passengerTemperature'] ?? 0,
);
}
@@ -176,7 +195,7 @@ class Vehicle {
@override
String toString() {
- return 'Vehicle(speed: $speed, insideTemperature: $insideTemperature, outsideTemperature: $outsideTemperature, range: $range, fuelLevel: $fuelLevel, mediaVolume: $mediaVolume, isChildLockActiveLeft: $isChildLockActiveLeft, isChildLockActiveRight: $isChildLockActiveRight, engineSpeed: $engineSpeed, frontLeftTire: $frontLeftTire, frontRightTire: $frontRightTire, rearLeftTire: $rearLeftTire, rearRightTire: $rearRightTire, isAirConditioningActive: $isAirConditioningActive, isFrontDefrosterActive: $isFrontDefrosterActive, isRearDefrosterActive: $isRearDefrosterActive, isRecirculationActive: $isRecirculationActive,fanSpeed:$fanSpeed)';
+ return 'Vehicle(speed: $speed, insideTemperature: $insideTemperature, outsideTemperature: $outsideTemperature, range: $range, fuelLevel: $fuelLevel, mediaVolume: $mediaVolume, isChildLockActiveLeft: $isChildLockActiveLeft, isChildLockActiveRight: $isChildLockActiveRight, engineSpeed: $engineSpeed, frontLeftTire: $frontLeftTire, frontRightTire: $frontRightTire, rearLeftTire: $rearLeftTire, rearRightTire: $rearRightTire, isAirConditioningActive: $isAirConditioningActive, isFrontDefrosterActive: $isFrontDefrosterActive, isRearDefrosterActive: $isRearDefrosterActive, isRecirculationActive: $isRecirculationActive,fanSpeed:$fanSpeed,driverTemperature:$driverTemperature, passengerTemperature:$passengerTemperature)';
}
@override
@@ -201,7 +220,9 @@ class Vehicle {
other.isFrontDefrosterActive == isFrontDefrosterActive &&
other.isRearDefrosterActive == isRearDefrosterActive &&
other.isRecirculationActive == isRecirculationActive &&
- other.fanSpeed == fanSpeed;
+ other.fanSpeed == fanSpeed &&
+ other.driverTemperature == driverTemperature &&
+ other.passengerTemperature == passengerTemperature;
}
@override
@@ -223,7 +244,9 @@ class Vehicle {
isFrontDefrosterActive.hashCode ^
isRearDefrosterActive.hashCode ^
isRecirculationActive.hashCode ^
- fanSpeed.hashCode;
+ fanSpeed.hashCode ^
+ driverTemperature.hashCode ^
+ passengerTemperature.hashCode;
}
// }
// / class VehicleNotifier extends StateNotifier<Vehicle> {