Я пытался с этим кодом, но не дает ожидаемого результата
setPolylines () asyn c {
List<PointLatLng> result = await polylinePoints.getRouteBetweenCoordinates(googleAPIKey,
SOURCE_LOCATION.latitude, SOURCE_LOCATION.longitude, DEST_LOCATION.latitude, DEST_LOCATION.longitude);
setState(() {
// create a Polyline instance
// with an id, an RGB color and the list of LatLng pairs
Polyline polyline = Polyline(
polylineId: PolylineId("poly"),
color: Color.fromARGB(255, 40, 122, 198),
points: polylineCoordinates);
// add the constructed polyline as a set of points
// to the polyline set, which will eventually
// end up showing up on the map
_polylines.add(polyline);
});
}