DirectionsResult class

Directions responses contain the following root elements:

  • status contains metadata on the request. See DirectionsStatus.

  • geocodedWaypoints contains an array with details about the geocoding of origin, destination and waypoints. See GeocodedWaypoint.

  • routes contains an array of routes from the origin to the destination. See DirectionsRoute. Routes consist of nested Legs and Steps.

  • availableTravelModes contains an array of available travel modes. This field is returned when a request specifies a travel mode and gets no results. The array contains the available travel modes in the countries of the given set of waypoints. This field is not returned if one or more of the waypoints are via: waypoints.

  • errorMessages contains more detailed information about the reasons behind the given status code.

Constructors

DirectionsResult({List<DirectionsRoute>? routes, List<GeocodedWaypoint>? geocodedWaypoints, DirectionsStatus? status, String? errorMessage, List<TravelMode>? availableTravelModes})
const
DirectionsResult.fromMap(Map<String, dynamic> map)
factory

Properties

availableTravelModes List<TravelMode>?
Contains an array of available travel modes. This field is returned when a request specifies a travel mode and gets no results. The array contains the available travel modes in the countries of the given set of waypoints. This field is not returned if one or more of the waypoints are via: waypoints. See details below.
final
errorMessage String?
When the status code is other than OK, there may be an additional errorMessage field within the Directions response object. This field contains more detailed information about the reasons behind the given status code.
final
geocodedWaypoints List<GeocodedWaypoint>?
Details about the geocoding of every waypoint, as well as origin and destination, can be found in the (JSON) geocoded_waypoints array. These can be used to infer why the service would return unexpected or no routes.
final
hashCode int
The hash code for this object.
no setterinherited
routes List<DirectionsRoute>?
When the Directions API returns results, it places them within a (JSON) routes array. Even if the service returns no results (such as if the origin and/or destination doesn't exist) it still returns an empty routes array. (XML responses consist of zero or more
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status DirectionsStatus?
The status field within the Directions response object contains the status of the request, and may contain debugging information to help you track down why the Directions service failed. The status field may contain the following values:
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited