push batch door sensor, design bugs

This commit is contained in:
ashrafzarkanisala
2024-10-02 01:41:15 +03:00
parent 0d49ad5106
commit 9dbf4b0540
16 changed files with 195 additions and 60 deletions

View File

@ -56,7 +56,11 @@ class _FactoryResetWidgetState extends State<FactoryResetWidget> {
backgroundColor: ColorsManager.greyColor,
child: Text(
'Cancel',
style: context.textTheme.bodyMedium,
style: context.textTheme.bodyMedium!.copyWith(
color: ColorsManager.blackColor,
fontWeight: FontWeight.w400,
fontSize: 12,
),
),
),
),
@ -69,8 +73,10 @@ class _FactoryResetWidgetState extends State<FactoryResetWidget> {
backgroundColor: ColorsManager.red,
child: Text(
'Reset',
style: context.textTheme.bodyMedium!
.copyWith(color: ColorsManager.whiteColors),
style: context.textTheme.bodyMedium!.copyWith(
color: ColorsManager.whiteColors,
fontWeight: FontWeight.w400,
fontSize: 12),
),
),
),

View File

@ -37,7 +37,7 @@ class DeviceBatchControlDialog extends StatelessWidget
Column(
children: [
Text(
devices.first.categoryName ?? 'Device Control',
getBatchDialogName(devices.first),
style: context.textTheme.titleLarge!.copyWith(
color: ColorsManager.dialogBlueTitle,
fontWeight: FontWeight.bold,
@ -65,7 +65,7 @@ class DeviceBatchControlDialog extends StatelessWidget
),
),
child: IconButton(
padding: EdgeInsets.all(1),
padding: const EdgeInsets.all(1),
icon: const Icon(
Icons.close,
color: Colors.grey,
@ -92,3 +92,42 @@ class DeviceBatchControlDialog extends StatelessWidget
);
}
}
String getBatchDialogName(AllDevicesModel device) {
/*
3G:
1G:
2G:
GW:
DL:
WPS:
CPS:
AC:
CUR:
WH:
*/
switch (device.productType) {
case '1G':
return "Smart Light Switch";
case '2G':
return "2Gang Light";
case '3G':
return "Living Room";
case 'GW':
return "GateWay";
case 'DL':
return "Door Lock";
case 'WPS':
return "White Presence Sensor";
case 'CPS':
return "Black Presence Sensor";
case 'CUR':
return "Smart Curtains";
case 'WH':
return "Smart Water Hater";
case 'AC':
return "Smart AC";
default:
return device.categoryName ?? 'Device Control';
}
}

View File

@ -87,7 +87,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
children: [
TableRow(
children: [
_buildInfoRow('Product Name:', device.categoryName ?? 'N/A'),
_buildInfoRow('Product Name:', device.productName ?? 'N/A'),
_buildInfoRow('Device ID:', device.uuid ?? ''),
],
),
@ -131,7 +131,7 @@ class DeviceControlDialog extends StatelessWidget with RouteControlsBasedCode {
'Last Offline Date and Time:',
formatDateTime(
DateTime.fromMillisecondsSinceEpoch(
((device.activeTime ?? 0) * 1000),
((device.updateTime ?? 0) * 1000),
),
),
),