mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 09:59:40 +00:00
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:
@ -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!
|
||||
|
@ -1,10 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/ACs/category_view_app_bar.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/three_gang/three_gang_interface_body.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
|
Reference in New Issue
Block a user