flutter_barcode_scanner icon indicating copy to clipboard operation
flutter_barcode_scanner copied to clipboard

Continous mode keeps previous listeners

Open hioshih opened this issue 3 years ago • 2 comments

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:

  1. call getBarcodeStreamReceiver
  2. press "cancel"
  3. call getBarcodeStreamReceiver
  4. the listener will be called twice
  5. on each repeat, a new listener will be called

Expected behavior Previous listeners should get disabled once clicked "Cancel"

hioshih avatar Aug 30 '21 17:08 hioshih

i have the same issue

fishdulyapath avatar Aug 31 '21 10:08 fishdulyapath

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.

ahmdqader avatar Sep 25 '21 19:09 ahmdqader