SpeedLimitController class
Controller for managing speed limits, speed cameras, and speed violation monitoring during navigation.
This controller handles:
- Current speed limit monitoring
- Speed limit violations detection
- Speed camera notifications
- User location tracking
- Route position monitoring
The controller provides comprehensive speed-related information through SpeedLimitModel, including current speed limits, violations, and speed camera warnings.
Usage example:
final controller = SpeedLimitController(
navigationManager: navigationManagerInstance,
);
// Access current speed information
print(controller.state.value.speedLimit);
print(controller.state.value.exceeding);
// Listen to speed-related updates
controller.state.addListener(() {
final model = controller.state.value;
if (model.exceeding) {
print('Warning: Speed limit exceeded!');
}
if (model.cameraProgressInfo != null) {
print('Approaching speed camera');
}
});
The controller maintains six main subscriptions:
- Location updates for current speed
- Route updates for speed limit data
- Position updates for current speed limits
- Speed violation monitoring
- Speed camera notifications
- Navigation state changes
Remember to dispose of the controller when it's no longer needed:
controller.dispose();
Constructors
- SpeedLimitController({ })
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
→ ValueNotifier<
SpeedLimitModel> -
no setter
Methods
-
dispose(
) → void -
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