RouteTracker class final

Uses a location to provide status and progress updates as a route is traversed (by a moving vehicle, for example).

RouteTracker can give the time or distance to the next maneuver, notify if the location is off-route, and regenerate a new route if necessary. Basic workflow:

  1. Create a new RouteTracker instance.
  2. Enable rerouting with RouteTracker.enableRerouting (if supported by the underlying route service).
  3. Use RouteTracker.trackLocation to track the location of the device.
  4. Subscribe to RouteTracker.onTrackingStatusChanged to get the TrackingStatus as the location changes.
  5. Subscribe to RouteTracker.onNewVoiceGuidance to get the VoiceGuidance whenever new instructions are available.
  6. If there are multiple stops, call RouteTracker.switchToNextDestination each time DestinationStatus.reached status is returned. Before calling RouteTracker.switchToNextDestination make sure that TrackingStatus.remainingDestinationCount > 1, a value of 1 means the last destination is being approached.
Implemented types

Properties

hashCode int
The hash code for this object.
no setterinherited
isReroutingEnabled bool
Reports if routes are automatically regenerated when tracking status is off-route. True if rerouting is enabled, otherwise False.
no setter
onNewVoiceGuidance Stream<VoiceGuidance>
Sets new voice guidance callback.
no setter
onRerouteCompleted Stream<({ArcGISException? error, TrackingStatus trackingStatus})>
Sets reroute completed callback.
no setter
onRerouteStarted Stream<void>
Sets reroute started callback.
no setter
onTrackingStatusChanged Stream<TrackingStatus>
Sets tracking status changed callback.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
skipCoincidentStops bool
Indicates if multiple stops in a row at the same location should treated as one stop.
no setter
trackingStatus TrackingStatus?
Status for the current location on the route.
no setter
voiceGuidanceUnitSystem UnitSystem
The unit system used in voice guidance commands.
getter/setter pair

Methods

cancelRerouting() → void
Cancels a running reroute task.
disableRerouting() → void
Disables automatic rerouting.
enableRerouting({required ReroutingParameters parameters}) Future<void>
Enables automatic rerouting when the tracker detects an off-route status.
generateVoiceGuidance() VoiceGuidance?
Gets the current VoiceGuidance object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setSpeechEngineReady(bool speechEngineReady()) → void
Sets a callback which returns the speech engine ready status.
switchToNextDestination() Future<void>
Starts tracking progress to the next destination in the ArcGISRoute.
toString() String
A string representation of this object.
inherited
trackLocation(ArcGISLocation location) Future<void>
Provides route tracking status relative to the provided location.

Operators

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

Static Methods

create({required RouteResult routeResult, required int routeIndex, required bool skipCoincidentStops}) RouteTracker?
Creates a Route Tracker using a specific route from a route result with an option to specify treating coincident stops as a single destination.