mapEventToState method

  1. @override
Stream<PeersState> mapEventToState(
  1. dynamic 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<PeersState> mapEventToState(
  dynamic event,
) async* {
  if (event is PeerAdd) {
    yield* _mapPeerAddToState(event);
  } else if (event is PeerAddShareScreen) {
    yield* _mapPeerAddShareScreenToState(event);
  } else if (event is PeerRemove) {
    yield* _mapPeerRemoveToState(event);
  } else if (event is PeerRemoveShareScreen) {
    yield* _mapPeerPeerRemoveShareScreenToState(event);
  } else if (event is PeerAddConsumer) {
    yield* _mapConsumerAddToState(event);
  } else if (event is PeerAddConsumerShareScreen) {
    yield* _mapConsumerAddShareScreenToState(event);
  } else if (event is PeerRemoveConsumer) {
    yield* _mapConsumerRemoveToState(event);
  } else if (event is PeerRemoveConsumerShareScreen) {
    yield* _mapConsumerRemoveShareScreenToState(event);
  } else if (event is PeerPausedConsumer) {
    yield* _mapPeerPausedConsumer(event);
  } else if (event is PeerResumedConsumer) {
    yield* _mapPeerResumedConsumer(event);
  } else if (event is PeerchangeDisplayNameConsumer) {
    yield* _mapPeerchangeDisplayNameConsumer(event);
  }
}