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

@ -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';
}
}