From 192c57fadc6283e0674aa8a3a31f313780cb3f28 Mon Sep 17 00:00:00 2001 From: Thomas Raddatz Date: Mon, 23 Dec 2024 15:49:04 +0100 Subject: [PATCH 1/4] Update SDK version for starting the app. --- example/android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 986ee288..6f492fc6 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 33 + compileSdkVersion 34 sourceSets { main.java.srcDirs += 'src/main/kotlin' From 15947a0cae2b26bf5c51aad94280abb712bad283 Mon Sep 17 00:00:00 2001 From: Thomas Raddatz Date: Mon, 23 Dec 2024 15:57:50 +0100 Subject: [PATCH 2/4] Fix 'LateInitializationError' exception. --- example/lib/src/ble/ble_device_connector.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/lib/src/ble/ble_device_connector.dart b/example/lib/src/ble/ble_device_connector.dart index 536ff8b0..91ac08c7 100644 --- a/example/lib/src/ble/ble_device_connector.dart +++ b/example/lib/src/ble/ble_device_connector.dart @@ -19,7 +19,7 @@ class BleDeviceConnector extends ReactiveState { final _deviceConnectionController = StreamController(); // ignore: cancel_subscriptions - late StreamSubscription _connection; + StreamSubscription? _connection; Future connect(String deviceId) async { _logMessage('Start connecting to $deviceId'); @@ -37,7 +37,7 @@ class BleDeviceConnector extends ReactiveState { Future disconnect(String deviceId) async { try { _logMessage('disconnecting to device: $deviceId'); - await _connection.cancel(); + await _connection?.cancel(); } on Exception catch (e, _) { _logMessage("Error disconnecting from a device: $e"); } finally { From f61dbf5de228a259d9ee08a09f2d9b257b68638c Mon Sep 17 00:00:00 2001 From: Thomas Raddatz Date: Mon, 23 Dec 2024 15:58:20 +0100 Subject: [PATCH 3/4] Fix expanding characteristics. --- example/lib/src/ui/device_detail/device_interaction_tab.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/lib/src/ui/device_detail/device_interaction_tab.dart b/example/lib/src/ui/device_detail/device_interaction_tab.dart index 02a2fb98..1759713f 100644 --- a/example/lib/src/ui/device_detail/device_interaction_tab.dart +++ b/example/lib/src/ui/device_detail/device_interaction_tab.dart @@ -285,7 +285,7 @@ class _ServiceDiscoveryListState extends State<_ServiceDiscoveryList> { child: ExpansionPanelList( expansionCallback: (int index, bool isExpanded) { setState(() { - if (isExpanded) { + if (!isExpanded) { _expandedItems.remove(index); } else { _expandedItems.add(index); From dfe3d6c1f579ae14bf589ddd0a3583e4fbcd8603 Mon Sep 17 00:00:00 2001 From: Thomas Raddatz Date: Mon, 23 Dec 2024 16:36:27 +0100 Subject: [PATCH 4/4] Fix another 'LateInitializationError' exception. --- .../src/ui/device_detail/characteristic_interaction_dialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/lib/src/ui/device_detail/characteristic_interaction_dialog.dart b/example/lib/src/ui/device_detail/characteristic_interaction_dialog.dart index 17f09231..98fd0301 100644 --- a/example/lib/src/ui/device_detail/characteristic_interaction_dialog.dart +++ b/example/lib/src/ui/device_detail/characteristic_interaction_dialog.dart @@ -35,7 +35,7 @@ class _CharacteristicInteractionDialogState extends State<_CharacteristicInterac late String writeOutput; late String subscribeOutput; late TextEditingController textEditingController; - late StreamSubscription>? subscribeStream; + StreamSubscription>? subscribeStream; @override void initState() {