mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 02:37:55 +00:00
Stabilized UI elements across multiple devices
Synchronized ACs Status functionality
This commit is contained in:
@@ -8,7 +8,7 @@ class DevicesCategoryModel {
|
||||
|
||||
final Widget page;
|
||||
|
||||
bool switchValue;
|
||||
bool devicesStatus = false;
|
||||
final List<ACModel> devices;
|
||||
|
||||
final DeviceType type;
|
||||
@@ -20,8 +20,21 @@ class DevicesCategoryModel {
|
||||
required this.type,
|
||||
required this.name,
|
||||
required this.icon,
|
||||
required this.switchValue,
|
||||
required this.devices});
|
||||
required this.devices}) {
|
||||
//sets the initial status of the devices
|
||||
if (devices.isNotEmpty) {
|
||||
bool tempStatus = devices.first.status;
|
||||
for (var device in devices) {
|
||||
if (device.status != tempStatus) {
|
||||
devicesStatus = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
devicesStatus = tempStatus;
|
||||
} else {
|
||||
devicesStatus = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum DeviceType {
|
||||
|
||||
Reference in New Issue
Block a user