handleInitEvent method
Handle the FastAppOnboardingBlocEventType.init event. This event is used to initialize the bloc. It will retrieve the onboarding data from the data provider and dispatch a FastAppOnboardingBlocEventType.initialized event.
Implementation
Stream<FastAppOnboardingBlocState> handleInitEvent() async* {
if (canInitialize) {
_logger.debug('Initializing...');
isInitializing = true;
yield currentState.copyWith(isInitializing: true);
final onboarding = await _retrievePersistedOnboarding();
addEvent(FastAppOnboardingBlocEvent.initialized(
FastAppOnboardingBlocEventPayload(
isCompleted: onboarding.isCompleted,
),
));
}
}