mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

previously scanned barcode is "scanned" on next start

Open lukepighetti opened this issue 1 year ago • 3 comments

  1. create controller
  2. scan a barcode "foo"
  3. dispose controller
  4. create new controller

result:

the new controller emits a scan even for barcode "foo" even though that barcode is not in front of the camera

expected result:

it waits until the next barcode is visible to scan it

things I tried:

  • disposing the controller
  • stopping the camera

ideas:

It seems like the last used frame is being read on new scanning sessions. If so, all frames in memory should be cleared when a new scanning session is started

lukepighetti avatar Dec 30 '23 19:12 lukepighetti

Just to be clear, do you mean the pixel buffer / texture? Or the barcodes list on the Dart-side?

(We did have an old bug where the pixel buffer was not cleared, so an old frame was still shown on the texture view. That bug was fixed though)

navaronbracke avatar Jan 05 '24 21:01 navaronbracke

I tried to reproduce this on version 3.5.6 on Android, but was unable to do so.

Things I did:

  • flutter run the example app on an Android device
  • go to the basic with Controller sample
  • scan a QR code with foo as content
  • exit the page to trigger disposal of the controller
  • go back to the with Controller sample
  • scan the foo barcode again

When returning to the page, it correctly started with "Scan a barcode" instead of the old value "foo"

Do you have more information on what version of the plugin you are using, and on what platform this is happening?

navaronbracke avatar Jan 08 '24 14:01 navaronbracke

@lukepighetti Is this still an issue on the latest beta? (mobile_scanner 5.0.0-beta.1)

navaronbracke avatar Mar 05 '24 09:03 navaronbracke