dispose method
Balances one initialize call. Monitoring stops, and an inactive state is emitted, only when the last caller disposes.
Implementation
@override
Future<void> dispose() => _serialized(() async {
if (_refCount == 0) return;
_refCount--;
if (_refCount > 0) return;
final subscription = _eventSubscription;
_eventSubscription = null;
await subscription?.cancel();
_emit(const CallState.initial());
await methodChannel.invokeMethod<void>('dispose');
});