handleInitializedEvent method

Handle the FastAppOnboardingBlocEventType.initialized event. This event is used to end the initialization process. It will set the bloc as initialized and dispatch a new state. The new state will contain the onboarding data retrieved from the data provider.

Implementation

Stream<FastAppOnboardingBlocState> handleInitializedEvent(
  FastAppOnboardingBlocEventPayload? payload,
) async* {
  if (isInitializing) {
    _logger.debug('Initialized');
    isInitialized = true;

    yield currentState.copyWith(
      isCompleted: payload?.isCompleted ?? false,
      isInitializing: false,
      isInitialized: true,
    );
  }
}