mapEventToState method

  1. @override
Stream<SectionState> mapEventToState(
  1. SectionEvent event
)

@Deprecated - Use on

Must be implemented when a class extends Bloc. mapEventToState is called whenever an event is added and is responsible for converting that event into a new state. mapEventToState can yield zero, one, or multiple states for an event.

Implementation

@override
Stream<SectionState> mapEventToState(
  SectionEvent event,
) async* {
  yield SectionLoading();
  if (event is SectionTapped) {
    yield* _mapSectionTappedToState(event);
  }
  if (event is SectionGoToLastReadingRequired) {
    yield* _mapSectionGoToLastReadingRequiredToState(event);
  }
}