bpillon / google_maps_cluster_manager

Simple Flutter clustering library for Google Maps
https://pub.dev/packages/google_maps_cluster_manager
MIT License
121 stars 94 forks source link

setMapId should check if mounted #41

Open cedvdb opened 2 years ago

cedvdb commented 2 years ago

setMapId should check if mounted. The below code from the lib can create error in some edge scenarios.

  void setMapId(int mapId, {bool withUpdate = true}) async {
    _mapId = mapId;
    _zoom = await GoogleMapsFlutterPlatform.instance.getZoomLevel(mapId: mapId);
    if (withUpdate) updateMap();
  }

related https://github.com/flutter/flutter/issues/101387