TransitDetails class
Transit directions return additional information that is not
relevant for other modes of transportation. These additional
properties are exposed through the transit object,
returned as a field of an element in the steps array. From
the TransitDetails object you can access additional
information about the transit stop, transit line and transit
agency.
A transit object may contain the following fields:
-
arrivalStopanddepartureStopcontains information about the stop/station for this part of the trip. Stop details can include: -
namethe name of the transit station/stop. eg. "Union Square". -
locationthe location of the transit station/stop, represented as a lat and lng field. -
arrivalTimeanddepartureTimecontain the arrival or departure times for this leg of the journey, specified as the following three properties: -
textthe time specified as a string. The time is displayed in the time zone of the transit stop. -
valuethe time specified as Unix time, or seconds since midnight, January 1, 1970 UTC. -
timeZonecontains the time zone of this station. The value is the name of the time zone as defined in the IANA Time Zone Database, e.g."America/New_York". -
headsignspecifies the direction in which to travel on this line, as it is marked on the vehicle or at the departure stop. This will often be the terminus station. -
headwayspecifies the expected number of seconds between departures from the same stop at this time. For example, with a headway value of 600, you would expect a ten minute wait if you should miss your bus. -
numStopscontains the number of stops in this step, counting the arrival stop, but not the departure stop. For example, if your directions involve leaving from Stop A, passing through stops B and C, and arriving at stop D,numStopswill return 3. -
tripShortNamecontains the text that appears in schedules and sign boards to identify a transit trip to passengers. The text should uniquely identify a trip within a service day. For example, "538" is thetripShortNameof the Amtrak train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA. -
linecontains information about the transit line used in this step, and may include the following properties: -
namecontains the full name of this transit line. eg. "7 Avenue Express". -
shortNamecontains the short name of this transit line. This will normally be a line number, such as "M7" or "355". -
colorcontains the color commonly used in signage for this transit line. The color will be specified as a hex string such as: #FF0033. -
agenciesis an array containing a single TransitAgency object. The DirectionsTransitAgency] object provides information about the operator of the line, including the following properties:namecontains the name of the transit agency.phonecontains the phone number of the transit agency.urlcontains the URL for the transit agency.
You must display the names and URLs of the transit agencies servicing the trip results.
urlcontains the URL for this transit line as provided by the transit agency.iconcontains the URL for the icon associated with this line.textColorcontains the color of text commonly used for signage of this line. The color will be specified as a hex string.vehiclecontains the type of vehicle used on this line. This may include the following properties:namecontains the name of the vehicle on this line. eg. "Subway."typecontains the type of vehicle that runs on this line. See the Vehicle Type documentation for a complete list of supported values.iconcontains the URL for an icon associated with this vehicle type.localIconcontains the URL for the icon associated with this vehicle type, based on the local transport signage.
Constructors
- TransitDetails({TransitStop? arrivalStop, TransitStop? departureStop, Time? arrivalTime, Time? departureTime, String? headsign, num? headway, TransitLine? line, num? numStops, String? tripShortName})
-
const
-
TransitDetails.fromMap(Map<
String, dynamic> map) -
factory
Properties
- arrivalStop → TransitStop?
-
Contains information about the stop/station for this part of
the trip. Stop details can include:
final
- arrivalTime → Time?
-
Contain the arrival times for this leg of the journey,
specified as the following three properties:
final
- departureStop → TransitStop?
-
Contains information about the stop/station for this part of
the trip. Stop details can include:
final
- departureTime → Time?
-
Contain the departure times for this leg of the journey,
specified as the following three properties:
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headsign → String?
-
Specifies the direction in which to travel on this line,
as it is marked on the vehicle or at the departure stop.
This will often be the terminus station.
final
- headway → num?
-
Specifies the expected number of seconds between departures
from the same stop at this time. For example, with a
headway value of 600, you would expect a ten minute wait if
you should miss your bus.
final
- line → TransitLine?
-
Contains information about the transit line used in this step.
final
- numStops → num?
-
Contains the number of stops in this step, counting the
arrival stop, but not the departure stop. For example,
if your directions involve leaving from Stop A, passing
through stops B and C, and arriving at stop D,
numStopswill return 3.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tripShortName → String?
-
Contains the text that appears in schedules and sign boards
to identify a transit trip to passengers. The text should
uniquely identify a trip within a service day. For example,
"538" is the
tripShortNameof the Amtrak train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA.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