push water leak device

This commit is contained in:
ashrafzarkanisala
2024-10-07 11:26:30 +03:00
parent 2b5249e985
commit 9ea8e3be2b
13 changed files with 772 additions and 27 deletions

View File

@ -14,6 +14,7 @@ class ReportsTable extends StatelessWidget {
bool? hideValueShowDescription;
bool? mainDoorSensor;
bool? garageDoorSensor;
bool? waterLeak;
ReportsTable({
super.key,
@ -25,6 +26,7 @@ class ReportsTable extends StatelessWidget {
this.hideValueShowDescription,
this.mainDoorSensor,
this.garageDoorSensor,
this.waterLeak,
});
@override
@ -55,7 +57,8 @@ class ReportsTable extends StatelessWidget {
DeviceEvent data = entry.value;
// Parse eventTime into Date and Time
DateTime eventDateTime = DateTime.fromMillisecondsSinceEpoch(data.eventTime!);
DateTime eventDateTime =
DateTime.fromMillisecondsSinceEpoch(data.eventTime!);
String date = DateFormat('dd/MM/yyyy').format(eventDateTime);
String time = DateFormat('HH:mm').format(eventDateTime);
@ -63,8 +66,12 @@ class ReportsTable extends StatelessWidget {
if (hideValueShowDescription == true) {
if (mainDoorSensor != null && mainDoorSensor == true) {
value = data.value == 'true' ? 'Open' : 'Close';
} else if (garageDoorSensor != null && garageDoorSensor == true) {
} else if (garageDoorSensor != null &&
garageDoorSensor == true) {
value = data.value == 'true' ? 'Opened' : 'Closed';
} else if (waterLeak != null && waterLeak == true) {
value =
data.value == 'normal' ? 'Normal' : 'Leak Detected';
} else {
value = '${data.value!} ${thirdColumnDescription ?? ''}';
}