handleResetEvent method
Handles the reset event by setting the isInitialized
and
isInitializing
flags to false
.
Emits the new state and triggers the init
event.
Yields a stream of state changes.
Implementation
@protected
Stream<S> handleResetEvent() async* {
debugLog('Resetting calculator', debugLabel: debugLabel);
isInitialized = false;
isInitializing = false;
yield currentState.copyWith(
isInitialized: isInitialized,
isInitializing: isInitializing,
) as S;
addEvent(FastCalculatorBlocEvent.init<R>());
}