ZoomController class
This controller handles:
- Zoom in/out operations
- Zoom buttons state management
- Continuous zoom functionality
- Zoom availability monitoring
The controller provides zoom control through ZoomModel and manages the state of zoom buttons based on current map zoom constraints.
Usage example:
final controller = ZoomController(
map: mapInstance,
);
// Check zoom buttons availability
print('Zoom in available: ${controller.state.value.zoomInEnabled}');
print('Zoom out available: ${controller.state.value.zoomOutEnabled}');
// Handle zoom in operation
controller.startZoomIn(); // Start zooming in
// ... after some time or user action
controller.endZoomIn(); // Stop zooming in
// Listen to zoom availability changes
controller.state.addListener(() {
final model = controller.state.value;
print('Zoom in ${model.zoomInEnabled ? "enabled" : "disabled"}');
print('Zoom out ${model.zoomOutEnabled ? "enabled" : "disabled"}');
});
The controller maintains two subscriptions for monitoring zoom button states and provides methods for both momentary and continuous zoom operations.
Remember to dispose of the controller when it's no longer needed:
controller.dispose();
Constructors
- ZoomController({required Map map})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- map → Map
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
→ ValueNotifier<
ZoomModel> -
no setter
Methods
-
dispose(
) → void -
endZoomIn(
) → void -
endZoomOut(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startZoomIn(
) → void -
startZoomOut(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited