mobile_scanner
mobile_scanner copied to clipboard
previously scanned barcode is "scanned" on next start
- create controller
- scan a barcode "foo"
- dispose controller
- 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
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)
I tried to reproduce this on version 3.5.6 on Android, but was unable to do so.
Things I did:
flutter runthe example app on an Android device- go to the basic
with Controllersample - scan a QR code with
fooas content - exit the page to trigger disposal of the controller
- go back to the
with Controllersample - scan the
foobarcode 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?
@lukepighetti Is this still an issue on the latest beta? (mobile_scanner 5.0.0-beta.1)