Bloc<S> constructor
Bloc<S> ({
- S? initialState,
- BlocMonitor<
Bloc, dynamic> monitor = const BlocEventsPrinter(),
initialState
is the state which is set at initialization. if its null, the initial state is set to busy.
Implementation
Bloc({S? initialState, BlocMonitor monitor = const BlocEventsPrinter()})
: _state = initialState,
_monitor = monitor {
_notifyListeners(BlocEventType.init);
_monitor.onInit(this, _state);
if (_state != null) {
_isBusy = false;
}
}