QR HID Reader

Pub Version Pub Likes Pub popularity Flutter Platform


Implementation of the QR scanner listener that handles output as keyboard events.

This package allows working easily with any scanners that support the HID mode. In this mode, scanners work like a keyboard that provides a sequence of keypress events.

This also means that you can use a hardware keyboard with emulators to mock the behavior of the scanner for the test.


To get scanned info you need to create one of available ScannerManager. It has a property scanned that is a publisher of any info which read by scanner.

Now available few types of the ScannerManager.


Simplest manager that just informs about information was scanned. Doesn't stop propagation of the scanned information.


The manager with agile customization. Passed delegate is used to determine should the read keyboard event be used or ignored. Also, propagation behavior can be set by the stopWhenCatch parameter.


Useful implementation to work with scanners that connected to the Android (only) system device. Android provides more information about a keyboard event, including ID of the source. You can setup your own target list of IDs.

Check specification.


Language-specific keyboards can have strange IDs out of specification list. For example, the Cyrillic keyboard on Macbook Pro M1 has ID 769.


First step create a manager.

final manager = AndroidScannerManager();

And then just subscribe to publisher any way that you need. For example:

  stream: manager.scanned,
  builder: (_, value) {
    return Text('Raw data: ${value.data}');


Add qr_hid_reader to your pubspec.yaml file:

  qr_hid_reader: $currentVersion$

At this moment, the current version of qr_hid_reader is qr_reader version.


All notable changes are mentioned in this file.


To report your issues, submit them directly in the Issues section.