Last active
December 8, 2020 23:29
-
-
Save VB10/eef1af887d83919138fb5a922353a0c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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