scientifichackers / flutter-rx-ble

A Flutter BLE plugin, based on RxAndroidBle and RxBluetoothKit.
GNU Lesser General Public License v3.0
35 stars 18 forks source link

Exception on PluginScaffold (_setChannelCallHandler) #23

Closed 01xJoao closed 4 years ago

01xJoao commented 5 years ago

When disconnecting from the bluetooth, is this method:

  static void _setChannelCallHandler(MethodChannel channel) {
    channel.setMethodCallHandler((call) async {
      final key = getCallHandlerKey(channel, call.method);
      final handlers = callHandlers[key];
      for (var handler in handlers) {
        handler(call.arguments);
      }
    });
  }

When searching for final handlers = callHandlers[key];

It doesn't find any handler with the key:

key = "com.pycampers.rx_ble/observeChar/1033260214/endOfStream"

callHandlers

0:"com.pycampers.rx_ble/connect/930490641/onSuccess" -> _CompactLinkedHashSet
1:"com.pycampers.rx_ble/connect/930490641/onError" -> _CompactLinkedHashSet
2:"com.pycampers.rx_ble/connect/930490641/endOfStream" -> _CompactLinkedHashSet

handlers = null