stop method

Future<void> stop()

Implementation

Future<void> stop() async {
  _stopped = true;
  _clearTimers();
  final session = _snapshot.session;
  _emit(_snapshot.copyWith(phase: ViewerSessionPhase.left));
  if (session != null && provider.leave != null) {
    try {
      await provider.leave!(session);
    } catch (_) {
      // Teardown is best-effort.
    }
  }
}