flutter_barcode_scanner
flutter_barcode_scanner copied to clipboard
Continous mode keeps previous listeners
Describe the bug Greeting! First of all, thank you very much for this awesome package.
That said, when using getBarcodeStreamReceiver to listen continuously for multiple inputs, after pressing cancel the listener should be disabled before the next session.
But once canceled and called getBarcodeStreamReceiver again, both the new listener and the previous one, will be called, cumulative.
Since there is no callback to know when "Cancel" was clicked, and thus no way to disable previous listeners, more and more listeners are created.
To Reproduce Steps to reproduce the behavior:
- call getBarcodeStreamReceiver
- press "cancel"
- call getBarcodeStreamReceiver
- the listener will be called twice
- on each repeat, a new listener will be called
Expected behavior Previous listeners should get disabled once clicked "Cancel"
i have the same issue
I solved the problem by adding one second between every scan to prevent fast duplicates, but I realized a new problem that the scanner doesn't scan what inside the frame only, its scanning the whole camera screen and this caused problem to me.