mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

`updateScanWindow` method broken

Open simplenotezy opened this issue 1 year ago • 3 comments

The updateScanWindow does not work. After calling the method, scanning is no longer possible. Nothing will be outputted to the stream.

Example repo: https://github.com/simplenotezy/broken-mobile-scanner-example

  • Clone the repository and run flutter run
  • Attempt to scan something. You should see it in debug console
  • Try to change the scanWindow by using the bottom right icon
  • Now you can no longer scan anything
  • It appears that if you remove the scanWindowUpdateThreshold: 1000 it works

simplenotezy avatar Jun 17 '24 11:06 simplenotezy

@simplenotezy To quote your earlier response

I set the treshold to 1000 because when scanning tickets for an event, I found it impossible for any operator to scan tickets faster than every 1 second

Do you mean using the scan timeout? The scanWindowUpdateThreshold is used to prevent the scan window quickly updating when for example the scanner dimensions change (for example due to a resize)

But yes, perhaps we can distinguish between the two in the docs a bit better.

navaronbracke avatar Jun 17 '24 12:06 navaronbracke

I see. I noticed that when using scanWindowUpdateThreshold to 0 barcodes keep being scanned very quickly. If I set it to 1000, barcodes will scan only once every 1 second. Or am I missing something here?

simplenotezy avatar Jun 18 '24 11:06 simplenotezy

You are probably still confusing the window dimension threshold with the scanner timeout? The scanWindowUpdateThreshold has nothing to do with durations.

navaronbracke avatar Jun 18 '24 11:06 navaronbracke