stop method

Future<void> stop()

Stops tracking.

Implementation

Future<void> stop() async {
  final isTrackingActiveBefore = await isTrackingActive();
  await _channel.invokeMethod('stop');

  // Simulate a [StoppedEvent] event on Android to match the iOS behavior
  if (_isAndroid && isTrackingActiveBefore) {
    _observer?.call(StoppedEvent());
  }
}