Skip to content
pubscout

native_barcode_scanner

1.0.13, released 8 months ago by freedelity.be

Fast barcode, QR, text, and MRZ scanner plugin using PlatformView and native side processing.

$ flutter pub add native_barcode_scanner
Source repository

What it does

Provides a widget to scan barcodes, QR codes, text, and MRZ from the camera stream. It leverages native SDKs (Google ML Kit and AVFoundation) and PlatformViews to minimize data transfer overhead between Dart and native code.

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

Use it when

  • You need high-performance barcode or QR scanning via the camera.
  • You also need MRZ or text recognition from the camera on supported platforms.
  • You want to avoid performance penalties from transferring raw video frames across platform channels.

Skip it when

  • You require MRZ or text recognition on iOS (not supported).
  • You need pure headless barcode processing without showing a camera preview widget.

Strengths

  • High performance due to PlatformView and native-side processing
  • Supports multiple formats of barcodes, text, and MRZ
  • Simple widget-based API

Weaknesses

  • Platform support varies for text and MRZ features (Android only, iOS unsupported for those)
  • Uses PlatformViews which have certain platform-specific limitations and tradeoffs

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
0

Add dependency to pubspec.yaml and use the BarcodeScannerWidget. Standard camera permissions apply.

Widget build(BuildContext context) {
  return BarcodeScannerWidget(
      onBarcodeDetected: (barcode) {
        print('Barcode detected: ${barcode.value} (format: ${barcode.format.name})');
      }
  );
}

Alternatives

Packages that do the same job and could replace native_barcode_scanner.