added Null state from the AC universal switch (in case the status for the ACs are different from each other)

This commit is contained in:
Mohammad Salameh
2024-03-03 11:37:30 +03:00
parent bcaed7a4b8
commit 7e98329738
8 changed files with 96 additions and 39 deletions

View File

@ -22,8 +22,10 @@ class CustomSwitch extends StatelessWidget {
height: 28.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24.0),
color: category.devicesStatus
? ColorsManager.primaryColor
color: category.devicesStatus != null
? category.devicesStatus!
? ColorsManager.primaryColor
: const Color(0xFFD9D9D9)
: const Color(0xFFD9D9D9),
),
child: Center(
@ -37,16 +39,20 @@ class CustomSwitch extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(2.0),
child: Container(
alignment: category.devicesStatus
? Alignment.centerRight
alignment: category.devicesStatus != null
? category.devicesStatus!
? Alignment.centerRight
: Alignment.centerLeft
: Alignment.centerLeft,
child: Container(
width: 20.0,
height: 20.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: category.devicesStatus
? ColorsManager.primaryColor
color: category.devicesStatus != null
? category.devicesStatus!
? ColorsManager.primaryColor
: Colors.grey
: Colors.grey,
),
),