directions method

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

Implementation

Future<DirectionsResponse> directions(
  Object /*Location|String*/ origin,
  Object /*Location|String*/ destination, {
  TravelMode? travelMode,
  List<Waypoint> waypoints = const [],
  bool alternatives = false,
  @Deprecated("[avoid] is deprecated, use [avoids] instead.")
      RouteType? avoid,
  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));
}