diff options
author | 2022-12-31 00:34:31 -0500 | |
---|---|---|
committer | 2022-12-31 00:38:36 -0500 | |
commit | 84ae05bc27cd9f5d461e75dfdb258e1a38c434b6 (patch) | |
tree | e8dc553cf3b9264c4081f1bb76a95dd7be2f5afc /lib/Kuksa-server/vehicle_class.dart | |
parent | 61da09ade5afc3ab340d514d581fa48a1208dcf1 (diff) |
Rework Riverpod provider usage
Replace the single Riverpod provider for all vehicle signals with
separate ones for each required signal used directly in the widgets
that require them. This is more in line with recommended Riverpod
practice, and should avoids driving full widget tree rebuilds on
every signal received.
Bug-AGL: SPEC-4660
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ibe1ff26f8cd95cbe9cbb477feaf31c9f4919bf6a
Diffstat (limited to 'lib/Kuksa-server/vehicle_class.dart')
-rw-r--r-- | lib/Kuksa-server/vehicle_class.dart | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/lib/Kuksa-server/vehicle_class.dart b/lib/Kuksa-server/vehicle_class.dart deleted file mode 100644 index c2f2ac2..0000000 --- a/lib/Kuksa-server/vehicle_class.dart +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -class VehicleSignal { - VehicleSignal({ - required this.speed, - required this.rpm, - required this.fuelLevel, - required this.frontLeftTP, - required this.frontRightTP, - required this.rearLeftTP, - required this.rearRightTP, - required this.isBatteryCharging, - required this.isChildLockActiveLeft, - required this.isChildLockActiveRight, - required this.currentLatitude, - required this.currentLongitude, - required this.fuelRate, - required this.insideTemperature, - required this.outsideTemperature, - }); - - final double speed; - final double rpm; - final double fuelLevel; - final double frontLeftTP; - final double frontRightTP; - final double rearLeftTP; - final double rearRightTP; - final bool isChildLockActiveLeft; - final bool isChildLockActiveRight; - final double currentLongitude; - final double currentLatitude; - final double fuelRate; - final int insideTemperature; - final int outsideTemperature; - - final bool isBatteryCharging; - - VehicleSignal copyWith({ - double? speed, - double? rpm, - double? fuelLevel, - double? frontLeftTP, - double? frontRightTP, - double? rearLeftTP, - double? rearRightTP, - bool? isBatteryCharging, - bool? isChildLockActiveLeft, - bool? isChildLockActiveRight, - double? currentLongitude, - double? currentLatitude, - double? fuelRate, - int? insideTemperature, - int? outsideTemperature, - }) { - return VehicleSignal( - speed: speed ?? this.speed, - rpm: rpm ?? this.rpm, - fuelLevel: fuelLevel ?? this.fuelLevel, - frontLeftTP: frontLeftTP ?? this.frontLeftTP, - frontRightTP: frontRightTP ?? this.frontRightTP, - rearLeftTP: rearLeftTP ?? this.rearLeftTP, - rearRightTP: rearRightTP ?? this.rearRightTP, - isChildLockActiveLeft: - isChildLockActiveLeft ?? this.isChildLockActiveLeft, - isChildLockActiveRight: - isChildLockActiveRight ?? this.isChildLockActiveRight, - isBatteryCharging: isBatteryCharging ?? this.isBatteryCharging, - currentLatitude: currentLatitude ?? this.currentLatitude, - currentLongitude: currentLongitude ?? this.currentLongitude, - fuelRate: fuelRate ?? this.fuelRate, - insideTemperature: insideTemperature ?? this.insideTemperature, - outsideTemperature: outsideTemperature ?? this.outsideTemperature, - ); - } -} |