onStreamCancelled method

  1. @override
void onStreamCancelled()
override

Called when all listeners unsubscribe from the location stream.

Used to optimize battery by stopping updates when not needed.

Implementation

@override
void onStreamCancelled() {
  try {
    methodChannel.invokeMethod('onStreamCancelled');
  } catch (e) {
    debugPrint('Error calling onStreamCancelled: $e');
  }
}