mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-14 17:25:50 +00:00
formatted all files.
This commit is contained in:
@ -41,7 +41,8 @@ class ReportsTable extends StatelessWidget {
|
||||
height: 100,
|
||||
child: Text(
|
||||
'No reports found',
|
||||
style: context.textTheme.bodyLarge!.copyWith(color: ColorsManager.grayColor),
|
||||
style: context.textTheme.bodyLarge!
|
||||
.copyWith(color: ColorsManager.grayColor),
|
||||
),
|
||||
)
|
||||
: Stack(
|
||||
@ -49,7 +50,8 @@ class ReportsTable extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Table(
|
||||
border: TableBorder.all(color: Colors.grey.shade300, width: 1),
|
||||
border:
|
||||
TableBorder.all(color: Colors.grey.shade300, width: 1),
|
||||
columnWidths: const {
|
||||
0: FlexColumnWidth(),
|
||||
1: FlexColumnWidth(),
|
||||
@ -66,28 +68,36 @@ class ReportsTable extends StatelessWidget {
|
||||
),
|
||||
if (report.data != null)
|
||||
...report.data!.asMap().entries.map((entry) {
|
||||
int index = entry.key;
|
||||
DeviceEvent data = entry.value;
|
||||
final index = entry.key;
|
||||
final data = entry.value;
|
||||
|
||||
// Parse eventTime into Date and Time
|
||||
DateTime eventDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(data.eventTime!);
|
||||
String date = DateFormat('dd/MM/yyyy').format(eventDateTime);
|
||||
String time = DateFormat('HH:mm').format(eventDateTime);
|
||||
final eventDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
data.eventTime!);
|
||||
final date =
|
||||
DateFormat('dd/MM/yyyy').format(eventDateTime);
|
||||
final time = DateFormat('HH:mm').format(eventDateTime);
|
||||
|
||||
String value;
|
||||
if (hideValueShowDescription == true) {
|
||||
if (mainDoorSensor != null && mainDoorSensor == 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';
|
||||
value = data.value == 'normal'
|
||||
? 'Normal'
|
||||
: 'Leak Detected';
|
||||
} else {
|
||||
value = '${data.value!} ${thirdColumnDescription ?? ''}';
|
||||
value =
|
||||
'${data.value!} ${thirdColumnDescription ?? ''}';
|
||||
}
|
||||
} else {
|
||||
value = '${data.value!} ${thirdColumnDescription ?? ''}';
|
||||
value =
|
||||
'${data.value!} ${thirdColumnDescription ?? ''}';
|
||||
}
|
||||
|
||||
return TableRow(
|
||||
|
Reference in New Issue
Block a user