Skip to content

Instantly share code, notes, and snippets.

@VB10
Last active December 8, 2020 23:29
Show Gist options
  • Save VB10/eef1af887d83919138fb5a922353a0c4 to your computer and use it in GitHub Desktop.
Save VB10/eef1af887d83919138fb5a922353a0c4 to your computer and use it in GitHub Desktop.
List<SingleChildWidget> providerItems = [ Provider.value(value: CustomMarkerManager())}]
class CustomMarkerManager extends CustomMarker {
Map<int, BitmapDescriptor> _markers = {};
Future<BitmapDescriptor> getCustomMarker({
int value,
Color clusterColor,
Color textColor,
int width,
}) async {
final marker = _markers[value];
if (marker != null) {
return marker;
} else {
final newMarker =
await CustomMarker(clusterColor: clusterColor, width: width, textColor: textColor, clusterSize: value)
.getCustomMarker();
_markers[value] = newMarker;
return newMarker;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment