LocationBloc constructor

LocationBloc()

Implementation

LocationBloc() : super(const LocationState()) {
  on<OnStartFollowingUser>(
      (event, emit) => emit(state.copyWith(followingUser: true)));
  on<OnStopFollowingUser>(
      (event, emit) => emit(state.copyWith(followingUser: false)));

  on<OnNewUserLocationEvent>((event, emit) => emit(state.copyWith(
        lastKnownLocation: event.newLocation,
        myLocationHistory: [...state.myLocationHistory, event.newLocation],
      )));
}