Refactor device status handling and update UI components

- Update device status handling from 'status' to 'isOnline' for consistency
- Remove unused imports and redundant code related to light switches
- Refactor UI components to use 'isOnline' instead of 'status' for device status
This commit is contained in:
Mohammad Salameh
2024-04-01 09:58:51 +03:00
parent 3031d19836
commit a20dfa3709
12 changed files with 152 additions and 545 deletions

View File

@ -28,7 +28,7 @@ class LightInterfaceSwitch extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyLarge(
text: light.status ?? false
text: light.isOnline ?? false
? StringsManager.on
: StringsManager.off,
style:
@ -37,7 +37,7 @@ class LightInterfaceSwitch extends StatelessWidget {
Container(
width: 35,
decoration: ShapeDecoration(
color: light.status ?? false
color: light.isOnline ?? false
? ColorsManager.primaryColorWithOpacity
: Colors.grey,
shape: const CircleBorder(),