fiz wizard issue

This commit is contained in:
mohammad
2024-10-07 15:24:06 +03:00
parent 281414ac41
commit b89053c1fb
5 changed files with 250 additions and 199 deletions
@@ -3,7 +3,6 @@ import 'package:dio/dio.dart';
import 'package:firebase_database/firebase_database.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/bloc/two_touch_bloc/two_touch_event.dart';
import 'package:syncrow_app/features/devices/bloc/two_touch_bloc/two_touch_state.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
@@ -30,14 +29,14 @@ class TwoTouchBloc extends Bloc<TwoTouchEvent, TwoTouchState> {
relay_status_2: status.off,
);
Timer? _timer;
bool twoTouchGroup = false;
List<DeviceModel> devicesList = [];
List<GroupTwoTouchModel> groupTwoTouchList = [];
bool allSwitchesOn = true;
bool toggleSchedule = true;
List<String> selectedDays = [];
bool createSchedule = false;
List<ScheduleModel> listSchedule = [];
@@ -586,12 +585,9 @@ class TwoTouchBloc extends Bloc<TwoTouchEvent, TwoTouchState> {
emit(UpdateGroupState(
twoTouchList: groupTwoTouchList, allSwitches: allSwitchesValue));
List<String> allDeviceIds =
groupTwoTouchList.map((device) => device.deviceId).toList();
final response = await DevicesAPI.deviceBatchController(
code: 'switch_1',
devicesUuid: allDeviceIds,
devicesUuid: [event.deviceId],
value: !event.value,
);
@@ -616,15 +612,13 @@ class TwoTouchBloc extends Bloc<TwoTouchEvent, TwoTouchState> {
allSwitchesValue = false;
}
});
List<String> allDeviceIds =
groupTwoTouchList.map((device) => device.deviceId).toList();
emit(UpdateGroupState(
twoTouchList: groupTwoTouchList, allSwitches: allSwitchesValue));
final response = await DevicesAPI.deviceBatchController(
code: 'switch_2',
devicesUuid: allDeviceIds,
devicesUuid: [event.deviceId],
value: !event.value,
);