push dialog changes in values

This commit is contained in:
ashrafzarkanisala
2024-07-28 05:04:57 +03:00
parent 0bda828161
commit 50b455b4ae
18 changed files with 645 additions and 33 deletions
@@ -315,6 +315,7 @@ class CreateSceneBloc extends Bloc<CreateSceneEvent, CreateSceneState>
automationTempTasksList.clear();
automationSelectedValues.clear();
automationComparatorValues.clear();
effectiveTime = null;
sceneType = CreateSceneEnum.none;
conditionRule = 'or';
emit(const CreateSceneWithTasks(success: true));
@@ -0,0 +1,30 @@
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:syncrow_app/features/scene/model/smart_scene_enable.dart';
part 'smart_scene_select_dart_event.dart';
part 'smart_scene_select_dart_state.dart';
class SmartSceneSelectBloc
extends Bloc<SmartSceneSelectEvent, SmartSceneSelectState> {
SmartSceneSelectBloc() : super(SmartSceneSelectInitial()) {
on<SmartSceneEnableEvent>(_onSmartSceneEnable);
on<SmartSceneClearEvent>(_smartSceneClear);
}
SmartSceneEnable? smartSceneEnable;
FutureOr<void> _onSmartSceneEnable(
SmartSceneEnableEvent event, Emitter<SmartSceneSelectState> emit) {
smartSceneEnable = event.smartSceneEnable;
emit(SmartSceneSelected(smartSceneEnable: smartSceneEnable!));
}
FutureOr<void> _smartSceneClear(
SmartSceneClearEvent event, Emitter<SmartSceneSelectState> emit) {
smartSceneEnable = null;
emit(SmartSceneSelectInitial());
}
}
@@ -0,0 +1,21 @@
part of 'smart_scene_select_dart_bloc.dart';
sealed class SmartSceneSelectEvent extends Equatable {
const SmartSceneSelectEvent();
@override
List<Object> get props => [];
}
class SmartSceneEnableEvent extends SmartSceneSelectEvent {
final SmartSceneEnable smartSceneEnable;
const SmartSceneEnableEvent(this.smartSceneEnable);
@override
List<Object> get props => [smartSceneEnable];
}
class SmartSceneClearEvent extends SmartSceneSelectEvent {
const SmartSceneClearEvent();
}
@@ -0,0 +1,19 @@
part of 'smart_scene_select_dart_bloc.dart';
sealed class SmartSceneSelectState extends Equatable {
const SmartSceneSelectState();
@override
List<Object> get props => [];
}
final class SmartSceneSelectInitial extends SmartSceneSelectState {}
class SmartSceneSelected extends SmartSceneSelectState {
final SmartSceneEnable smartSceneEnable;
const SmartSceneSelected({required this.smartSceneEnable});
@override
List<Object> get props => [smartSceneEnable];
}