getDirections function

Future<Directions> getDirections(
  1. double lat1,
  2. double lng1,
  3. double lat2,
  4. double lng2, {
  5. String? googleAPIKey,
  6. String? mode,
  7. String? language,
})

Get the shortest route according to Google Maps between this two points.

@throw DirectionsException.

Implementation

Future<Directions> getDirections(
  double lat1,
  double lng1,
  double lat2,
  double lng2, {
  String? googleAPIKey,
  String? mode,
  String? language,
}) async {
  return await DirectionsRepository().get(
    origin: AddressPoint(lat: lat1, lng: lng1),
    destination: AddressPoint(lat: lat2, lng: lng2),
    googleAPIKey: googleAPIKey ?? GoogleMapsDirections.googleApiKey,
    mode: mode,
    language: language,
  );
}