EditorBloc constructor

EditorBloc()

Implementation

EditorBloc() : super(InitialEditorState()) {
  if (instance != null) {
    instance!.close();
  }
  instance = this;
  on<AppStartedEvent>((event, emit) => onAppStartedEvent());
  on<ScreenInitEvent>(onScreenInitEvent);
  on<LoadScreenEvent>(
      (event, emit) => emit(LoadScreenState(event.screenId, event.state)));
  on<LoadComponentEvent>(
      (event, emit) => emit(LoadComponentState(event.componentId)));
  on<ScreenUpdatedEvent>(
      (event, emit) => emit(ScreenUpdatedState(event.screenId)));
  on<ComponentUpdatedEvent>(
      (event, emit) => emit(ComponentUpdatedState(event.componentId)));
  on<TemplateUpdatedEvent>((event, emit) => emit(TemplateUpdatedState()));
  on<RequestUpdatedEvent>(
      (event, emit) => emit(RequestUpdatedState(event.requestId)));
  on<SelectEvent>((event, emit) => _selectEvent(event));
  on<ClientSelectWidgetEvent>(
      (event, emit) => emit(SelectWidgetState(event.id)));
  on<LogEvent>(onLogEvent);
}