directions method

Future<DirectionsResponse> directions(
  1. Object origin,
  2. Object destination, {
  3. TravelMode? travelMode,
  4. List<Waypoint> waypoints = const [],
  5. bool alternatives = false,
  6. List<RouteType> avoids = const [],
  7. String? language,
  8. Unit? units,
  9. String? region,
  10. Object? arrivalTime,
  11. Object? departureTime,
  12. List<TransitMode> transitMode = const [],
  13. TrafficModel? trafficModel,
  14. TransitRoutingPreferences? transitRoutingPreference,
})

Implementation

Future<DirectionsResponse> directions(
  Object /*Location|String*/ origin,
  Object /*Location|String*/ destination, {
  TravelMode? travelMode,
  List<Waypoint> waypoints = const [],
  bool alternatives = false,
  List<RouteType> avoids = const [],
  String? language,
  Unit? units,
  String? region,
  Object? /*DateTime|num*/ arrivalTime,
  Object? /*DateTime|num|String('now')*/ departureTime,
  List<TransitMode> transitMode = const [],
  TrafficModel? trafficModel,
  TransitRoutingPreferences? transitRoutingPreference,
}) async {
  final url = buildUrl(
    origin: origin,
    destination: destination,
    travelMode: travelMode,
    waypoints: waypoints,
    alternatives: alternatives,
    avoids: avoids,
    language: language,
    units: units,
    region: region,
    arrivalTime: arrivalTime,
    departureTime: departureTime,
    transitMode: transitMode,
    trafficModel: trafficModel,
    transitRoutingPreference: transitRoutingPreference,
  );
  return _decode(await doGet(url, headers: apiHeaders));
}