GeoformBloc constructor

GeoformBloc({
  1. String? regionName,
  2. MapProvider? mapProvider,
  3. LatLng? initialPosition,
  4. required AnimationController animationController,
})

Implementation

GeoformBloc({
  String? regionName,
  MapProvider? mapProvider,
  LatLng? initialPosition,
  required AnimationController animationController,
}) : super(GeoformState.initial(
          regionName: regionName,
          mapProvider: mapProvider,
          initialPosition: initialPosition,
          animationController: animationController)) {
  on<ManualChanged>(_onManualChanged);
  on<GeoformContextUpdated>(_onGeoformContextUpdated);
  on<GeoformOnTap>(_onGeoformOnTap);
  on<AddRegion>(_onAddRegion);
  on<ChangeMapPosition>(_onChangeMapPosition);
  on<ChangeMarkers>(_onChangeMarkers);
  on<AddAnimation>(_onAddAnimation);
  on<ChangeActivateAction>(_onActivateAction);

  _mapEventSubscription = state.mapController.mapEventStream.listen(
    (event) => add(
      ChangeMapPosition(
        position: LatLng(
          event.center.latitude,
          event.center.longitude,
        ),
      ),
    ),
  )..pause();
}