attach method

void attach(
  1. int id
)

Implementation

void attach(int id) {
  _channel = EventChannel('${_scanType}_$id/event');
  _methodChannel = MethodChannel('${_scanType}_$id/method');
  _stream = _channel.receiveBroadcastStream(
    {
      "isPlay": isPlay,
    },
  );
  _subscription = _stream.listen((data) {
    this.result = RScanResult.formMap(data);
    notifyListeners();
  });
}