Closed carlodenardin closed 2 months ago
What version of the plugin do you use?
@navaronbracke 4.0.1, The second time in which I scan the QRCode with DetectionSpeed.normal
the error appears and the bloc event is triggered.
The error
Bad state: on<ScannerCheckQRCode> was called multiple times. There should only be a single event handler per event type
indicates an error with your BloC implementation?
For example, the code sample on https://pub.dev/packages/bloc only sets an on<T>
event handler in the constructor of the CounterBloc, which is only created once. The documentation specifies this as well:
Register event handler for an event of type E. There should only ever be one event handler per event type E.
I'm using mobile_scanner In my app and I use Bloc to manage the states. I do not know why the Event is not triggered at the first scan, the scanner works and I can also print the rawValue of the barcode. The problem is that the ScannerCheckQRCode is not triggered but if I scan the qrcode a second time it is triggered but I get this error:
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: on<ScannerCheckQRCode> was called multiple times. There should only be a single event handler per event type.
I tried to use the controller with the
noDuplicates
but It do not trigger the event the first time so after that the qrcode is not detected anymore.