stop method

Future<void> stop()

Implementation

Future<void> stop() async {
  if (_registration != null) {
    try {
      await unregister(_registration!);
    } on Object catch (e) {
      if (kDebugMode) print(e);
    } finally {
      _registration = null;
    }
  }
  if (_discovery != null) {
    try {
      await stopDiscovery(_discovery!);
      _discovery?.dispose();
    } on Object catch (e) {
      if (kDebugMode) print(e);
    } finally {
      _discovery = null;
    }
  }
}