SearchBloc constructor

SearchBloc({
  1. required TrafficService trafficService,
})

Implementation

SearchBloc({required this.trafficService}) : super(const SearchState()) {
  on<OnEnableManualMarkerEvent>(
      (event, emit) => emit(state.copyWith(displayManualMarker: true)));
  on<OnDisableManualMarkerEvent>(
      (event, emit) => emit(state.copyWith(displayManualMarker: false)));
  on<OnNewPlacesFoundEvent>(
      (event, emit) => emit(state.copyWith(places: event.places)));
  on<OnAddPlaceEvent>((event, emit) =>
      emit(state.copyWith(history: [event.place, ...state.history])));
  on<OnDeleteHistoryEvent>(
      (event, emit) => emit(state.copyWith(history: [])));
}