1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
|
// SPDX-License-Identifier: Apache-2.0
//import 'dart:ffi';
//import 'dart:io';
import 'package:meta/meta.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
// Vehicle Speed
@immutable
class VehicleSignalSpeed {
const VehicleSignalSpeed({required this.speed});
final double speed;
VehicleSignalSpeed copyWith({double? speed}) {
return VehicleSignalSpeed(speed: speed ?? this.speed);
}
}
class VehicleSignalSpeedNotifier extends StateNotifier<VehicleSignalSpeed> {
VehicleSignalSpeedNotifier() : super(_initialValue);
static final VehicleSignalSpeed _initialValue = VehicleSignalSpeed(speed: 60);
void update({double? speed}) {
state = state.copyWith(speed: speed);
}
}
final vehicleSignalSpeedProvider =
StateNotifierProvider<VehicleSignalSpeedNotifier, VehicleSignalSpeed>(
(ref) => VehicleSignalSpeedNotifier(),
);
// Engine Speed
@immutable
class VehicleSignalEngineSpeed {
const VehicleSignalEngineSpeed({required this.speed});
final double speed;
VehicleSignalEngineSpeed copyWith({double? speed}) {
return VehicleSignalEngineSpeed(speed: speed ?? this.speed);
}
}
class VehicleSignalEngineSpeedNotifier
extends StateNotifier<VehicleSignalEngineSpeed> {
VehicleSignalEngineSpeedNotifier() : super(_initialValue);
static final VehicleSignalEngineSpeed _initialValue =
VehicleSignalEngineSpeed(speed: 2000);
void update({double? speed}) {
state = state.copyWith(speed: speed);
}
}
final vehicleSignalEngineSpeedProvider = StateNotifierProvider<
VehicleSignalEngineSpeedNotifier, VehicleSignalEngineSpeed>(
(ref) => VehicleSignalEngineSpeedNotifier(),
);
// Fuel Level
@immutable
class VehicleSignalFuelLevel {
const VehicleSignalFuelLevel({required this.level});
final double level;
VehicleSignalFuelLevel copyWith({double? level}) {
return VehicleSignalFuelLevel(level: level ?? this.level);
}
}
class VehicleSignalFuelLevelNotifier
extends StateNotifier<VehicleSignalFuelLevel> {
VehicleSignalFuelLevelNotifier() : super(_initialValue);
static final VehicleSignalFuelLevel _initialValue =
VehicleSignalFuelLevel(level: 90);
void update({double? level}) {
state = state.copyWith(level: level);
}
}
final vehicleSignalFuelLevelProvider = StateNotifierProvider<
VehicleSignalFuelLevelNotifier, VehicleSignalFuelLevel>(
(ref) => VehicleSignalFuelLevelNotifier(),
);
// Fuel Rate
@immutable
class VehicleSignalFuelRate {
const VehicleSignalFuelRate({required this.rate});
final double rate;
VehicleSignalFuelRate copyWith({double? rate}) {
return VehicleSignalFuelRate(rate: rate ?? this.rate);
}
}
class VehicleSignalFuelRateNotifier
extends StateNotifier<VehicleSignalFuelRate> {
VehicleSignalFuelRateNotifier() : super(_initialValue);
static final VehicleSignalFuelRate _initialValue =
VehicleSignalFuelRate(rate: 21);
void update({double? rate}) {
state = state.copyWith(rate: rate);
}
}
final vehicleSignalFuelRateProvider =
StateNotifierProvider<VehicleSignalFuelRateNotifier, VehicleSignalFuelRate>(
(ref) => VehicleSignalFuelRateNotifier(),
);
// Front Left Tire Pressure
@immutable
class VehicleSignalFrontLeftTirePressure {
const VehicleSignalFrontLeftTirePressure({required this.pressure});
final double pressure;
VehicleSignalFrontLeftTirePressure copyWith({double? pressure}) {
return VehicleSignalFrontLeftTirePressure(
pressure: pressure ?? this.pressure);
}
}
class VehicleSignalFrontLeftTirePressureNotifier
extends StateNotifier<VehicleSignalFrontLeftTirePressure> {
VehicleSignalFrontLeftTirePressureNotifier() : super(_initialValue);
static final VehicleSignalFrontLeftTirePressure _initialValue =
VehicleSignalFrontLeftTirePressure(pressure: 32);
void update({double? pressure}) {
state = state.copyWith(pressure: pressure);
}
}
final vehicleSignalFrontLeftTirePressureProvider = StateNotifierProvider<
VehicleSignalFrontLeftTirePressureNotifier,
VehicleSignalFrontLeftTirePressure>(
(ref) => VehicleSignalFrontLeftTirePressureNotifier(),
);
// Front Right Tire Pressure
@immutable
class VehicleSignalFrontRightTirePressure {
const VehicleSignalFrontRightTirePressure({required this.pressure});
final double pressure;
VehicleSignalFrontRightTirePressure copyWith({double? pressure}) {
return VehicleSignalFrontRightTirePressure(
pressure: pressure ?? this.pressure);
}
}
class VehicleSignalFrontRightTirePressureNotifier
extends StateNotifier<VehicleSignalFrontRightTirePressure> {
VehicleSignalFrontRightTirePressureNotifier() : super(_initialValue);
static final VehicleSignalFrontRightTirePressure _initialValue =
VehicleSignalFrontRightTirePressure(pressure: 32);
void update({double? pressure}) {
state = state.copyWith(pressure: pressure);
}
}
final vehicleSignalFrontRightTirePressureProvider = StateNotifierProvider<
VehicleSignalFrontRightTirePressureNotifier,
VehicleSignalFrontRightTirePressure>(
(ref) => VehicleSignalFrontRightTirePressureNotifier(),
);
// Rear Left Tire Pressure
@immutable
class VehicleSignalRearLeftTirePressure {
const VehicleSignalRearLeftTirePressure({required this.pressure});
final double pressure;
VehicleSignalRearLeftTirePressure copyWith({double? pressure}) {
return VehicleSignalRearLeftTirePressure(
pressure: pressure ?? this.pressure);
}
}
class VehicleSignalRearLeftTirePressureNotifier
extends StateNotifier<VehicleSignalRearLeftTirePressure> {
VehicleSignalRearLeftTirePressureNotifier() : super(_initialValue);
static final VehicleSignalRearLeftTirePressure _initialValue =
VehicleSignalRearLeftTirePressure(pressure: 33);
void update({double? pressure}) {
state = state.copyWith(pressure: pressure);
}
}
final vehicleSignalRearLeftTirePressureProvider = StateNotifierProvider<
VehicleSignalRearLeftTirePressureNotifier,
VehicleSignalRearLeftTirePressure>(
(ref) => VehicleSignalRearLeftTirePressureNotifier(),
);
// Rear Right Tire Pressure
@immutable
class VehicleSignalRearRightTirePressure {
const VehicleSignalRearRightTirePressure({required this.pressure});
final double pressure;
VehicleSignalRearRightTirePressure copyWith({double? pressure}) {
return VehicleSignalRearRightTirePressure(
pressure: pressure ?? this.pressure);
}
}
class VehicleSignalRearRightTirePressureNotifier
extends StateNotifier<VehicleSignalRearRightTirePressure> {
VehicleSignalRearRightTirePressureNotifier() : super(_initialValue);
static final VehicleSignalRearRightTirePressure _initialValue =
VehicleSignalRearRightTirePressure(pressure: 34);
void update({double? pressure}) {
state = state.copyWith(pressure: pressure);
}
}
final vehicleSignalRearRightTirePressureProvider = StateNotifierProvider<
VehicleSignalRearRightTirePressureNotifier,
VehicleSignalRearRightTirePressure>(
(ref) => VehicleSignalRearRightTirePressureNotifier(),
);
// Left Child Lock Active
@immutable
class VehicleSignalLeftChildLockActive {
const VehicleSignalLeftChildLockActive({required this.engaged});
final bool engaged;
VehicleSignalLeftChildLockActive copyWith({bool? engaged}) {
return VehicleSignalLeftChildLockActive(engaged: engaged ?? this.engaged);
}
}
class VehicleSignalLeftChildLockActiveNotifier
extends StateNotifier<VehicleSignalLeftChildLockActive> {
VehicleSignalLeftChildLockActiveNotifier() : super(_initialValue);
static final VehicleSignalLeftChildLockActive _initialValue =
VehicleSignalLeftChildLockActive(engaged: true);
void update({bool? engaged}) {
state = state.copyWith(engaged: engaged);
}
}
final vehicleSignalLeftChildLockActiveProvider = StateNotifierProvider<
VehicleSignalLeftChildLockActiveNotifier, VehicleSignalLeftChildLockActive>(
(ref) => VehicleSignalLeftChildLockActiveNotifier(),
);
// Right Child Lock Active
@immutable
class VehicleSignalRightChildLockActive {
const VehicleSignalRightChildLockActive({required this.engaged});
final bool engaged;
VehicleSignalRightChildLockActive copyWith({bool? engaged}) {
return VehicleSignalRightChildLockActive(engaged: engaged ?? this.engaged);
}
}
class VehicleSignalRightChildLockActiveNotifier
extends StateNotifier<VehicleSignalRightChildLockActive> {
VehicleSignalRightChildLockActiveNotifier() : super(_initialValue);
static final VehicleSignalRightChildLockActive _initialValue =
VehicleSignalRightChildLockActive(engaged: true);
void update({bool? engaged}) {
state = state.copyWith(engaged: engaged);
}
}
final vehicleSignalRightChildLockActiveProvider = StateNotifierProvider<
VehicleSignalRightChildLockActiveNotifier,
VehicleSignalRightChildLockActive>(
(ref) => VehicleSignalRightChildLockActiveNotifier(),
);
// Battery Charging
@immutable
class VehicleSignalBatteryCharging {
const VehicleSignalBatteryCharging({required this.charging});
final bool charging;
VehicleSignalBatteryCharging copyWith({bool? charging}) {
return VehicleSignalBatteryCharging(charging: charging ?? this.charging);
}
}
class VehicleSignalBatteryChargingNotifier
extends StateNotifier<VehicleSignalBatteryCharging> {
VehicleSignalBatteryChargingNotifier() : super(_initialValue);
static final VehicleSignalBatteryCharging _initialValue =
VehicleSignalBatteryCharging(charging: true);
void update({bool? charging}) {
state = state.copyWith(charging: charging);
}
}
final vehicleSignalBatteryChargingProvider = StateNotifierProvider<
VehicleSignalBatteryChargingNotifier, VehicleSignalBatteryCharging>(
(ref) => VehicleSignalBatteryChargingNotifier(),
);
// Inside Temperature
@immutable
class VehicleSignalInsideTemp {
const VehicleSignalInsideTemp({required this.temp});
final double temp;
VehicleSignalInsideTemp copyWith({double? temp}) {
return VehicleSignalInsideTemp(temp: temp ?? this.temp);
}
}
class VehicleSignalInsideTempNotifier
extends StateNotifier<VehicleSignalInsideTemp> {
VehicleSignalInsideTempNotifier() : super(_initialValue);
static final VehicleSignalInsideTemp _initialValue =
VehicleSignalInsideTemp(temp: 25);
void update({double? temp}) {
state = state.copyWith(temp: temp);
}
}
final vehicleSignalInsideTempProvider = StateNotifierProvider<
VehicleSignalInsideTempNotifier, VehicleSignalInsideTemp>(
(ref) => VehicleSignalInsideTempNotifier(),
);
// Outside Temperature
@immutable
class VehicleSignalOutsideTemp {
const VehicleSignalOutsideTemp({required this.temp});
final double temp;
VehicleSignalOutsideTemp copyWith({double? temp}) {
return VehicleSignalOutsideTemp(temp: temp ?? this.temp);
}
}
class VehicleSignalOutsideTempNotifier
extends StateNotifier<VehicleSignalOutsideTemp> {
VehicleSignalOutsideTempNotifier() : super(_initialValue);
static final VehicleSignalOutsideTemp _initialValue =
VehicleSignalOutsideTemp(temp: 32);
void update({double? temp}) {
state = state.copyWith(temp: temp);
}
}
final vehicleSignalOutsideTempProvider = StateNotifierProvider<
VehicleSignalOutsideTempNotifier, VehicleSignalOutsideTemp>(
(ref) => VehicleSignalOutsideTempNotifier(),
);
|