SpeedLimitService class
Service responsible for querying PowerMap Speed Limit API with built-in multi-layer throttling and caching to prevent excessive API requests.
Constructors
- SpeedLimitService({Client? client, Duration minInterval = const Duration(seconds: 4), double minDistanceMeters = 30.0})
Properties
- cachedResult → SpeedLimitResult?
-
Gets the currently cached speed limit result if available.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- minDistanceMeters → double
-
Minimum distance threshold in meters before requesting speed limit again (default: 30 meters)
final
- minInterval → Duration
-
Minimum time interval required between network requests (default: 4 seconds)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getSpeedLimit(
LatLng location) → Future< SpeedLimitResult?> -
Fetches speed limit for given
location(lat, lon) with intelligent rate-limiting. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Resets the cached state and throttling parameters.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited