getRoute method
Future<PolylineResult>
getRoute(
- LatLng currentPosition,
- LatLng centerPosition,
- String userkey
)
Implementation
Future<PolylineResult> getRoute(
LatLng currentPosition, LatLng centerPosition, String userkey) async {
PolylinePoints polylinePoints = PolylinePoints();
return await polylinePoints.getRouteBetweenCoordinates(
userkey,
PointLatLng(currentPosition.latitude, currentPosition.longitude),
PointLatLng(centerPosition.latitude, centerPosition.longitude),
travelMode: TravelMode.driving,
);
}