mapEventToState method Null safety

  1. @override
Stream<ProfileState> mapEventToState(
  1. ProfileEvent event
)
override

@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<ProfileState> mapEventToState(ProfileEvent event) async* {
  //
  if (event is GetProfileEvent) {
    yield* _mapProfileState();
  } else if (event is UploadImageEvent) {
    yield* _mapUploadImageToState(event);
  } else if (event is UpdateAvatarEvent) {
    yield* _mapUpdateAvatarToState(event);
  } else if (event is UpdateNicknameEvent) {
    yield* _mapUpdateNicknameToState(event);
  } else if (event is UpdateDescriptionEvent) {
    yield* _mapUpdateDescriptionToState(event);
  } else if (event is UpdateMobileEvent) {
    yield* _mapUpdateMobileToState(event);
  } else if (event is UpdateSexEvent) {
    yield* _mapUpdateSexToState(event);
  } else if (event is UpdateLocationEvent) {
    yield* _mapUpdateLocationToState(event);
  } else if (event is UpdateBirthdayEvent) {
    yield* _mapUpdateBirthdayToState(event);
  } else if (event is QueryFollowEvent) {
    yield* _mapQueryFollowToState(event);
  } else if (event is UserFollowEvent) {
    yield* _mapUserFollowToState(event);
  } else if (event is UserUnfollowEvent) {
    yield* _mapUserUnfollowToState(event);
  }
}