mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
push garage door records
This commit is contained in:
@ -13,6 +13,7 @@ class ReportsTable extends StatelessWidget {
|
||||
final VoidCallback onClose;
|
||||
bool? hideValueShowDescription;
|
||||
bool? mainDoorSensor;
|
||||
bool? garageDoorSensor;
|
||||
|
||||
ReportsTable({
|
||||
super.key,
|
||||
@ -23,6 +24,7 @@ class ReportsTable extends StatelessWidget {
|
||||
this.thirdColumnDescription,
|
||||
this.hideValueShowDescription,
|
||||
this.mainDoorSensor,
|
||||
this.garageDoorSensor,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -53,30 +55,31 @@ 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);
|
||||
|
||||
String value;
|
||||
if (hideValueShowDescription == true) {
|
||||
if (mainDoorSensor != null && mainDoorSensor == true) {
|
||||
value = data.value == 'true' ? 'Open' : 'Close';
|
||||
} else if (garageDoorSensor != null && garageDoorSensor == true) {
|
||||
value = data.value == 'true' ? 'Opened' : 'Closed';
|
||||
} else {
|
||||
value = '${data.value!} ${thirdColumnDescription ?? ''}';
|
||||
}
|
||||
} else {
|
||||
value = '${data.value!} ${thirdColumnDescription ?? ''}';
|
||||
}
|
||||
|
||||
return TableRow(
|
||||
children: [
|
||||
TableCellWidget(value: date),
|
||||
TableCellWidget(value: time),
|
||||
hideValueShowDescription == true
|
||||
? TableCellWidget(
|
||||
value: (mainDoorSensor != null &&
|
||||
mainDoorSensor == true)
|
||||
? data.value == 'true'
|
||||
? 'Open'
|
||||
: 'Close'
|
||||
: thirdColumnDescription ?? '',
|
||||
onTap: () => onRowTap(index),
|
||||
)
|
||||
: TableCellWidget(
|
||||
value:
|
||||
'${data.value!} ${thirdColumnDescription ?? ''}',
|
||||
onTap: () => onRowTap(index),
|
||||
),
|
||||
TableCellWidget(
|
||||
value: value,
|
||||
onTap: () => onRowTap(index),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
Reference in New Issue
Block a user