AbstractFormBusObserverCubit<S extends AbstractFormBaseState> constructor
AbstractFormBusObserverCubit<S extends AbstractFormBaseState> (
- S initialState, [
- ModelValidator? modelValidator
Creates an AbstractFormBusObserverCubit.
initialState: The initial state of the cubit.modelValidator: An optional validator for the model (can be null). Automatically subscribes to the event bus and listens for events.
Implementation
AbstractFormBusObserverCubit(super.initialState, [super.modelValidator]) {
// Subscribe to the event bus stream and call `observe` when an event is received
_eventBusStreamSubscription = eventBus.stream.listen(observe);
}