enableFollowMode method

Future<void> enableFollowMode()

Locks camera smoothly on device location.

Uses Geolocator position stream for battery-efficient updates.

Implementation

Future<void> enableFollowMode() async {
  final hasPermission = await requestPermission();
  if (!hasPermission) return;

  _mode = TrackingMode.follow;
  modeNotifier.value = _mode;

  // Enable native MapLibre blue dot
  await mapController.updateMyLocationTrackingMode(
    MyLocationTrackingMode.tracking,
  );

  // Start Geolocator stream for smooth camera follow
  await _startPositionStream();

  // Jump to current location immediately
  await _jumpToCurrentLocation();
}