Refactor device control logic and add temperature and fan speed enums

- Refactor device control logic in the app to improve readability and maintainability.
- Add temperature modes (hot, cold, wind) and fan speeds (auto, low, middle, high) enums.
- Update icon mappings and utility functions for temperature modes and fan speeds.
This commit is contained in:
Mohammad Salameh
2024-04-03 18:54:21 +03:00
parent 6577652702
commit bff4b9493c
30 changed files with 183 additions and 107 deletions

View File

@ -23,16 +23,16 @@ class GangSwitch extends StatelessWidget {
: InkWell(
overlayColor: MaterialStateProperty.all(Colors.transparent),
onTap: () {
DevicesCubit.get(context)
.deviceControl(control)
.then((value) {
print('Device control response: $value');
if (control.value ?? true) {
control.value = false;
} else {
control.value = true;
}
});
// DevicesCubit.getInstance()
// .deviceControl(control)
// .then((value) {
// print('Device control response: $value');
// if (control.value ?? true) {
// control.value = false;
// } else {
// control.value = true;
// }
// });
},
child: Stack(
alignment: !control.value!