Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some bug fixes #888

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions example/lib/src/ble/ble_device_connector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BleDeviceConnector extends ReactiveState<ConnectionStateUpdate> {
final _deviceConnectionController = StreamController<ConnectionStateUpdate>();

// ignore: cancel_subscriptions
late StreamSubscription<ConnectionStateUpdate> _connection;
StreamSubscription<ConnectionStateUpdate>? _connection;
Copy link
Collaborator

@Taym95 Taym95 Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will close this, since #889 just got merged and contains these chnages


Future<void> connect(String deviceId) async {
_logMessage('Start connecting to $deviceId');
Expand All @@ -37,7 +37,7 @@ class BleDeviceConnector extends ReactiveState<ConnectionStateUpdate> {
Future<void> 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _CharacteristicInteractionDialogState extends State<_CharacteristicInterac
late String writeOutput;
late String subscribeOutput;
late TextEditingController textEditingController;
late StreamSubscription<List<int>>? subscribeStream;
StreamSubscription<List<int>>? subscribeStream;

@override
void initState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down