4scene_and_6scene

This commit is contained in:
mohammad
2024-11-24 11:49:56 +03:00
parent 3d17c588c5
commit 6733c4f4ab
7 changed files with 32 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/material.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/6_scene_switch_bloc/6_scene_event.dart';
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_state.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
@ -129,8 +130,8 @@ class SixSceneBloc extends Bloc<SixSceneEvent, SixSceneState> {
allDevices.forEach((element) {
allDevicesIds.add(element.uuid!);
});
await HomeCubit.getInstance().fetchUnitsByUserId();
CustomSnackBar.displaySnackBar('Save Successfully');
emit(SaveSelectionSuccessState());
}
} catch (e) {

View File

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/material.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/four_scene_bloc/four_scene_event.dart';
import 'package:syncrow_app/features/devices/bloc/four_scene_bloc/four_scene_state.dart';
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
@ -482,7 +483,6 @@ class FourSceneBloc extends Bloc<FourSceneEvent, FourSceneState> {
}
emit(UpdateStateList(groupDevices: groupDevices, devices: devices));
}
void _assignDevice(
AssignRoomEvent event, Emitter<FourSceneState> emit) async {
try {
@ -498,6 +498,7 @@ class FourSceneBloc extends Bloc<FourSceneEvent, FourSceneState> {
allDevices.forEach((element) {
allDevicesIds.add(element.uuid!);
});
await HomeCubit.getInstance().fetchUnitsByUserId();
CustomSnackBar.displaySnackBar('Save Successfully');
emit(SaveSelectionSuccessState());

View File

@ -78,6 +78,10 @@ class DeviceModel {
tempIcon = Assets.waterLeakIcon;
} else if (type == DeviceType.PC) {
tempIcon = Assets.powerClampIcon;
} else if (type == DeviceType.FourScene) {
tempIcon = Assets.fourSceneHomeIcon;
} else if (type == DeviceType.SixScene) {
tempIcon = Assets.sixSceneHomeIcon;
} else {
tempIcon = Assets.assetsIconsLogo;
}