make stuff unawaited + maybe fix edge case?

chore/offband-rebrand
Leah 5 months ago
parent 9332d8126f
commit 01c8390989
No known key found for this signature in database

@ -50,9 +50,8 @@ class _ScannerScreenState extends State<ScannerScreen> {
_bluetoothState = state;
});
// Cancel scan if Bluetooth turns off while scanning
if (state != BluetoothAdapterState.on &&
connector.state == MeshCoreConnectionState.scanning) {
connector.stopScan();
if (state != BluetoothAdapterState.on) {
unawaited(connector.stopScan());
}
}
});
@ -62,7 +61,7 @@ class _ScannerScreenState extends State<ScannerScreen> {
void dispose() {
final connector = Provider.of<MeshCoreConnector>(context, listen: false);
connector.removeListener(_connectionListener);
_bluetoothStateSubscription.cancel();
unawaited(_bluetoothStateSubscription.cancel());
super.dispose();
}

Loading…
Cancel
Save

Powered by TurnKey Linux.