Closed devais-eng closed 4 years ago
The method observeConnectionState always throws a TypeError since release 2.2.7 , making it unusable.
observeConnectionState
2.2.7
type '_BroadcastStream<dynamic>' is not a subtype of type 'Stream<String>'
The problem seems to be caused by this line: https://github.com/Polidea/FlutterBleLib/blob/6f05b2fb3cfbeaee260f57d6106fc9ca0f878dca/lib/src/bridge/device_connection_mixin.dart#L41
A working solution might be mapping over the source BroadcastStream:
.map((dynamic state) => state.toString())
I hope this was helpful.
Thank you for your awesome work.
I only see now that you have already opened a PR for this bug.
I'll reference it here: #498
The method
observeConnectionState
always throws a TypeError since release2.2.7
, making it unusable.The problem seems to be caused by this line: https://github.com/Polidea/FlutterBleLib/blob/6f05b2fb3cfbeaee260f57d6106fc9ca0f878dca/lib/src/bridge/device_connection_mixin.dart#L41
A working solution might be mapping over the source BroadcastStream:
I hope this was helpful.
Thank you for your awesome work.