SpeedTiers class
Speed-based update interval tiers.
Configures how update intervals change based on current speed.
Constructors
- SpeedTiers({SpeedTier stationary = const SpeedTier(name: 'stationary', minSpeedKph: 0, maxSpeedKph: 0, updateInterval: 60, distanceFilter: 50, accuracy: DesiredAccuracy.low), SpeedTier walking = const SpeedTier(name: 'walking', minSpeedKph: 0, maxSpeedKph: 5, updateInterval: 20, distanceFilter: 15, accuracy: DesiredAccuracy.medium), SpeedTier city = const SpeedTier(name: 'city', minSpeedKph: 5, maxSpeedKph: 30, updateInterval: 10, distanceFilter: 10, accuracy: DesiredAccuracy.high), SpeedTier suburban = const SpeedTier(name: 'suburban', minSpeedKph: 30, maxSpeedKph: 80, updateInterval: 7, distanceFilter: 15, accuracy: DesiredAccuracy.high), SpeedTier highway = const SpeedTier(name: 'highway', minSpeedKph: 80, maxSpeedKph: 999, updateInterval: 5, distanceFilter: 25, accuracy: DesiredAccuracy.high)})
-
Creates speed tiers.
const
- SpeedTiers.fromMap(JsonMap map)
-
Creates from a map.
factory
Properties
- city → SpeedTier
-
Tier for city driving (5-30 km/h).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highway → SpeedTier
-
Tier for highway driving (>80 km/h).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stationary → SpeedTier
-
Tier for stationary (0 km/h).
final
- suburban → SpeedTier
-
Tier for suburban driving (30-80 km/h).
final
- walking → SpeedTier
-
Tier for walking speed (<5 km/h).
final
Methods
-
getTier(
double speedKph) → SpeedTier - Gets the appropriate tier for a given speed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → JsonMap - Converts to a JSON-serializable map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- balanced → const SpeedTiers
- Balanced preset - good for most use cases.
- conservative → const SpeedTiers
- Conservative preset - maximize battery savings.
- driving → const SpeedTiers
- Driving-optimized - higher frequency at high speeds.