mapEventToState method

Main function to map incoming events to state changes. This function reacts to incoming life cycle events and updates the state accordingly.

Implementation

@override
Stream<FastAppLifecycleBlocState> mapEventToState(
  FastAppLifecycleBlocEvent event,
) async* {
  final payload = event.payload;
  final type = event.type;

  _logger.debug('Event received: $type');

  if (type == FastAppLifecycleBlocEventType.lifecycleChanged) {
    yield* _handleLifecycleChanged(payload);
  }
}