TimeDistance class Core
Time and distance value object used for routing results.
TimeDistance separates unrestricted and restricted time/distance components which allows callers to present more detailed ETA and routing information (for example when parts of a route are subject to restrictions).
Instances are typically obtained from NavigationInstruction or RouteInstruction.
See also:
- NavigationInstruction - Obtain time and distance from/to various points during navigation
- RouteInstruction - Obtain time and distance from/to various points from route instructions
Constructors
- TimeDistance.new({int unrestrictedTimeS = 0, int restrictedTimeS = 0, int unrestrictedDistanceM = 0, int restrictedDistanceM = 0, double ndBeginEndRatio = -1.0})
- Constructor with unrestricted and restricted times and distances
-
TimeDistance.fromJson(Map<
String, dynamic> json) -
factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasRestrictedBeginEndDifferentiation → bool
-
Whether restricted begin/end differentiation is available.
no setter
- isEmpty → bool
-
Check if empty (no travel time).
no setter
- isNotEmpty → bool
-
Check if not empty.
no setter
- ndBeginEndRatio ↔ double
-
Restricted begin/end ratio.
getter/setter pair
- restrictedDistanceAtBegin → int
-
Restricted distance at begin (computed from restrictedDistanceM and
ndBeginEndRatio).
no setter
- restrictedDistanceAtEnd → int
-
Restricted distance at end (computed from restrictedDistanceM and
ndBeginEndRatio).
no setter
- restrictedDistanceM ↔ int
-
Restricted distance in meters
getter/setter pair
- restrictedTimeAtBegin → int
-
Restricted time at begin (computed from restrictedTimeS and
ndBeginEndRatio).
no setter
- restrictedTimeAtEnd → int
-
Restricted time at end (computed from restrictedTimeS and
ndBeginEndRatio).
no setter
- restrictedTimeS ↔ int
-
Restricted time in seconds
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalDistanceM → int
-
Total distance in meters
no setter
- totalTimeS → int
-
Total time in seconds
no setter
- unrestrictedDistanceM ↔ int
-
Unrestricted distance in meters.
getter/setter pair
- unrestrictedTimeS ↔ int
-
Unrestricted time in seconds.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes this instance to a JSON-compatible map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator +(
TimeDistance other) → TimeDistance - Adds two TimeDistance instances together.
-
operator ==(
covariant TimeDistance other) → bool -
The equality operator.
override