Skip to content
pubscout

flutter_barcode_listener

0.1.4, released 3 years ago by integrator.hr

Listen for any hardware barcode scanner without manufacturer SDKs.

WASM-ready
$ flutter pub add flutter_barcode_listener
Source repository

What it does

It listens for raw keyboard events from hardware barcode scanners that act as keyboards. It groups fast character sequences ending with an enter key and triggers a callback when a barcode is recognized.

AI-written summary of version 0.1.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using a hardware barcode scanner that acts as a keyboard and doesn't require focus on a text input.
  • You need cross-platform support for hardware scanners without implementing per-manufacturer SDKs.

Skip it when

  • You only need to capture barcodes via the device's built-in camera.
  • You are satisfied with using a focused text input control (TextField) to capture scanned text.

Strengths

  • Supports external hardware scanners including bluetooth and wifi ones.
  • Cross-platform support across Android, iOS, web, Windows, macOS, and Linux.
  • Does not require manufacturer-specific SDKs.

Weaknesses

  • Relies on timing and buffering heuristics to differentiate between manual typing and barcode scans.
  • May require tuning parameters like bufferDuration or useKeyDown depending on the platform.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
BarcodeListener(
  onBarcodeScanned: (barcode) {
    print(barcode);
  },
  child: Text('My App'),
)

Alternatives

Packages that do the same job and could replace flutter_barcode_listener.