shaxxx / flutter_barcode_listener

Flutter widget to listen for scanned barcode via hardware scanners
MIT License
46 stars 47 forks source link

Q: #29

Closed craigbrown-nist closed 1 year ago

craigbrown-nist commented 2 years ago

Is it possible to have the widget gain focus, or to defocus any other widget(s) once the barcode has been determined?

I have a build that has some input widgets above a visibility widgets and the barcode scanner as used in the example and it works great (windows version) if you click off the other widgets that take input.

However, if focus is in one of those other input fields the also get the barcode as keypresses.

I have tried adding in a 'WidgetsBinding.instance.focusManager.primaryFocus?.unfocus();' call just above the barcode scanner, but it doesn't work.

Any one have a suggestion in how to do this?

danielroek commented 2 years ago

Not really sure what you are trying to achieve without some code examples

shaxxx commented 1 year ago

Closed due to missing information.