Rouatbi Daly
Rouatbi Daly

Reputation: 86

How does Flutter application get a barcode from the handheld barcode scanner?

I need to read a barcode for a flutter application by using a handheld barcode scanner. After pressing the trigger, the handheld barcode scanner reads the barcode and tries to send the value automatically to the input text that has focused.

enter image description here

Upvotes: 3

Views: 7768

Answers (3)

Sanket
Sanket

Reputation: 272

It depends which scanning device you are using. In market there are various barcode scanner devices like scanbot, dynasoft, zebra scanner,etc. I would recommend you to use Zebra scanner. Below is the link of zebra scanner home page where you can find the scanner devices and Android SDK and some sample demo codes https://www.zebra.com/ap/en/support-downloads/scanners.html

If you are planning to integrate scanner with flutter application then you need to find plugin or write yourself a plugin

I have made a plugin for zebra barcode scanner. You can try this plugin zebra_scanner_plugin

I have tested it using the Zebra DS2278 model.

Upvotes: 4

Yves Boutellier
Yves Boutellier

Reputation: 2044

Use this library flutter_barcode_listener

It works like the following.

  1. listen for physical keyboard raw key up event
  2. filter out only 'REAL' characters (ASCII codes lower than 256, without special characters except enter)
  3. on each new key check if previous key is older than bufferDuration, if it's older clear internal buffer
  4. check if new key is enter key, if it is call onBarcodeScanned callback and clear buffer
  5. if it's not enter key just append it to internal buffer;

Upvotes: 1

Houssem TRABELSI
Houssem TRABELSI

Reputation: 852

You can use the bare-code reader as an external keyboard over usb with your mobile or tablet .It will works fine .

enter image description here

Upvotes: 1

Related Questions