stopScan method

Future<void> stopScan()

Implementation

Future<void> stopScan() async {
  if (!_isScanning) return;

  await _scanSubscription?.cancel();
  _scanSubscription = null;

  try {
    await FlutterBluePlus.stopScan();
  } catch (e) {
    // Ignore stop scan errors
  }

  _isScanning = false;
}