Created
December 6, 2020 21:04
-
-
Save VB10/6b7626acb3aff28cec981a5df8952b72 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
Future<void> initMapControllerMarkers(GoogleMapController controller, | |
BuildContext context, List<Coordinate> coordinates) async { | |
CustomMarkerManager markerManager = context.read<CustomMarkerManager>(); | |
for (var i = 0; i < coordinates.length; i++) { | |
final icon = await markerManager.getCustomMarker( | |
value: i, | |
clusterColor: Colors.orange, | |
textColor: Colors.white, | |
width: _markersWidth); | |
markers.add(Marker( | |
markerId: MarkerId(i.toString()), | |
position: coordinates[i].coordinate, | |
icon: icon)); | |
} | |
emit(GoogleMapsStateMarkers(controller, 0, markers)); | |
} | |
void updateMarkerWithNumber(int index, Coordinate coordinate) { | |
state.controller | |
.animateCamera(CameraUpdate.newLatLng(coordinate.coordinate)); | |
emit(MapsMarkerChange(state.controller, index)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment