getRoute method

Future<PolylineResult> getRoute(
  1. LatLng currentPosition,
  2. LatLng centerPosition,
  3. 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,
  );
}