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
|
// SPDX-License-Identifier: Apache-2.0
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:dashboard_app/size.dart';
import '../vehicle-signals/vss_providers.dart';
class ChildLockStatus extends ConsumerWidget {
ChildLockStatus({Key? key}) : super(key: key);
@override
Widget build(BuildContext context, WidgetRef ref) {
final vehicleLeftChildLockActive =
ref.watch(vehicleSignalLeftChildLockActiveProvider);
final vehicleRightChildLockActive =
ref.watch(vehicleSignalRightChildLockActiveProvider);
return vehicleLeftChildLockActive.engaged &&
vehicleRightChildLockActive.engaged
? Column(
children: [
Text(
"Child Lock",
style: TextStyle(
fontSize: SizeConfig.fontsize / 3, color: Colors.green),
),
Text(
"Activated",
style: TextStyle(
fontSize: SizeConfig.fontsize / 3, color: Colors.green),
),
SizedBox(
width: SizeConfig.safeBlockVertical / 2,
),
Icon(
Icons.lock,
size: SizeConfig.fontsize / 3,
color: Colors.green,
),
],
)
: Column(
children: [
Text(
'No child Lock',
style: TextStyle(
fontSize: SizeConfig.fontsize / 2,
color: Colors.redAccent,
),
),
SizedBox(
height: SizeConfig.safeBlockVertical / 2,
),
Icon(
Icons.lock_open_outlined,
size: SizeConfig.fontsize / 4,
color: Colors.red,
),
],
);
}
}
|