From c7b619a607c82a4512eb72386d26eead377fa2d2 Mon Sep 17 00:00:00 2001 From: task-win <119512221+task-win@users.noreply.github.com> Date: Wed, 31 Jul 2024 22:33:28 +0200 Subject: [PATCH] the _scanResults.value returns a nullable List --- lib/bluetooth_print.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bluetooth_print.dart b/lib/bluetooth_print.dart index 6f24a872f..79b2aecdb 100644 --- a/lib/bluetooth_print.dart +++ b/lib/bluetooth_print.dart @@ -93,9 +93,9 @@ class BluetoothPrint { .doOnDone(stopScan) .map((map) { final device = BluetoothDevice.fromJson(Map.from(map)); - final List list = _scanResults.value; + final List? list = _scanResults.value; int newIndex = -1; - list.asMap().forEach((index, e) { + list!.asMap().forEach((index, e) { if (e.address == device.address) { newIndex = index; }