mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-17 02:25:16 +00:00
clear smart scene status
This commit is contained in:
@ -18,6 +18,7 @@ import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_view.
|
|||||||
import 'package:syncrow_app/features/devices/view/widgets/devices_view_body.dart';
|
import 'package:syncrow_app/features/devices/view/widgets/devices_view_body.dart';
|
||||||
import 'package:syncrow_app/features/menu/view/menu_view.dart';
|
import 'package:syncrow_app/features/menu/view/menu_view.dart';
|
||||||
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
||||||
|
import 'package:syncrow_app/features/scene/bloc/smart_scene/smart_scene_select_dart_bloc.dart';
|
||||||
import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart';
|
import 'package:syncrow_app/features/scene/enum/create_scene_enum.dart';
|
||||||
import 'package:syncrow_app/features/scene/model/scene_settings_route_arguments.dart';
|
import 'package:syncrow_app/features/scene/model/scene_settings_route_arguments.dart';
|
||||||
import 'package:syncrow_app/features/scene/view/create_scene_view.dart';
|
import 'package:syncrow_app/features/scene/view/create_scene_view.dart';
|
||||||
@ -57,13 +58,12 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future fetchUserInfo() async {
|
||||||
Future fetchUserInfo() async {
|
|
||||||
try {
|
try {
|
||||||
var uuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
|
var uuid =
|
||||||
|
await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
|
||||||
user = await ProfileApi().fetchUserInfo(uuid);
|
user = await ProfileApi().fetchUserInfo(uuid);
|
||||||
emit(HomeUserInfoLoaded(user!)); // Emit state after fetching user info
|
emit(HomeUserInfoLoaded(user!)); // Emit state after fetching user info
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -382,6 +382,9 @@ class HomeCubit extends Cubit<HomeState> {
|
|||||||
NavigationService.navigatorKey.currentContext!
|
NavigationService.navigatorKey.currentContext!
|
||||||
.read<CreateSceneBloc>()
|
.read<CreateSceneBloc>()
|
||||||
.add(const SceneTypeEvent(CreateSceneEnum.none));
|
.add(const SceneTypeEvent(CreateSceneEnum.none));
|
||||||
|
NavigationService.navigatorKey.currentContext!
|
||||||
|
.read<SmartSceneSelectBloc>()
|
||||||
|
.add(const SmartSceneClearEvent());
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
@ -5,8 +5,10 @@ import 'package:syncrow_app/features/devices/view/widgets/scene_listview.dart';
|
|||||||
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
||||||
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
|
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
|
||||||
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
|
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
|
||||||
|
import 'package:syncrow_app/features/scene/bloc/smart_scene/smart_scene_select_dart_bloc.dart';
|
||||||
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_grid_view.dart';
|
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_grid_view.dart';
|
||||||
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_header.dart';
|
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_header.dart';
|
||||||
|
import 'package:syncrow_app/features/scene/widgets/select_smart_scene/smart_enable_autoamtion.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/create_unit.dart';
|
import 'package:syncrow_app/features/shared_widgets/create_unit.dart';
|
||||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||||
import 'package:syncrow_app/utils/context_extension.dart';
|
import 'package:syncrow_app/utils/context_extension.dart';
|
||||||
@ -38,6 +40,9 @@ class SceneView extends StatelessWidget {
|
|||||||
.add(LoadScenes(HomeCubit.getInstance().selectedSpace!.id!));
|
.add(LoadScenes(HomeCubit.getInstance().selectedSpace!.id!));
|
||||||
BlocProvider.of<SceneBloc>(context).add(
|
BlocProvider.of<SceneBloc>(context).add(
|
||||||
LoadAutomation(HomeCubit.getInstance().selectedSpace!.id!));
|
LoadAutomation(HomeCubit.getInstance().selectedSpace!.id!));
|
||||||
|
context
|
||||||
|
.read<SmartSceneSelectBloc>()
|
||||||
|
.add(const SmartSceneClearEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return BlocListener<SceneBloc, SceneState>(
|
return BlocListener<SceneBloc, SceneState>(
|
||||||
|
Reference in New Issue
Block a user