MyLocationController class

Controller for managing map camera behavior and user location tracking modes.

This controller handles:

  • Camera behavior changes
  • Location tracking modes
  • Location button state and icon
  • User interaction with location tracking

Usage example:

final controller = MyLocationController(
  map: mapInstance,
);

// Check current state
print(controller.state.value.isActive);

// Handle user interaction
controller.processTap();

// Listen to state changes
controller.state.addListener(() {
  final model = controller.state.value;
  print('Active: ${model.isActive}');
  print('Current behaviour: ${model.behaviour}');
});

Remember to dispose of the controller when it's no longer needed:

controller.dispose();

Constructors

MyLocationController.new({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<MyLocationModel>
The current state of location tracking as a ValueNotifier
no setter

Methods

dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processTap() → void
Handles user interaction with the location button.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited