diff --git a/lib/pages/bootloader_recovery_update_page.dart b/lib/pages/bootloader_recovery_update_page.dart index f537ad1..79f6138 100644 --- a/lib/pages/bootloader_recovery_update_page.dart +++ b/lib/pages/bootloader_recovery_update_page.dart @@ -35,6 +35,7 @@ class BootloaderRecoveryUpdatePage extends ConsumerStatefulWidget { class _BootloaderRecoveryUpdatePageState extends ConsumerState { FirmwareUpdateService? _firmwareUpdateService; + BluetoothController? _bluetooth; StreamSubscription? _firmwareProgressSubscription; DfuUpdateProgress _dfuProgress = const DfuUpdateProgress( state: DfuUpdateState.idle, @@ -60,7 +61,7 @@ class _BootloaderRecoveryUpdatePageState @override void dispose() { final service = _firmwareUpdateService; - final bluetooth = ref.read(bluetoothProvider).valueOrNull; + final bluetooth = _bluetooth; _firmwareUpdateService = null; unawaited(_firmwareProgressSubscription?.cancel()); unawaited(() async { @@ -105,6 +106,7 @@ class _BootloaderRecoveryUpdatePageState if (bluetooth == null) { return null; } + _bluetooth = bluetooth; final service = FirmwareUpdateService( verifyAfterFinish: false,