Skip to content
pubscout

google_mlkit_barcode_scanning

1.0.3, released 8 days ago by flutter-ml.dev

A Flutter plugin to use Google's ML Kit Barcode Scanning on Android and iOS.

$ flutter pub add google_mlkit_barcode_scanning
Source repository

What it does

A Flutter plugin that leverages Google's ML Kit Barcode Scanning native APIs to read data encoded using most standard barcode formats from an input image. It processes images asynchronously via platform channels to keep the user interface responsive.

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

Use it when

  • You need to scan standard barcode formats or QR codes using Google's ML Kit on mobile.
  • You want on-device barcode recognition without sending data to external servers.

Skip it when

  • You need web or desktop platform support.
  • You want a package maintained directly by Google.

Strengths

  • Supports a wide range of standard barcode formats and types.
  • Executes native on-device processing via Google's ML Kit.

Weaknesses

  • Only supports mobile platforms (iOS and Android).
  • Requires specific platform configurations (e.g., minimum iOS deployment target 15.0 and Android SDK configuration).

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
1

Requires setting minimum iOS deployment target to 15.0, adding specific linker flags (-ObjC, -all_load) in Xcode for Swift Package Manager, and configuring Android compile and min SDK requirements.

final List<BarcodeFormat> formats = [BarcodeFormat.all];
final barcodeScanner = BarcodeScanner(formats: formats);
final List<Barcode> barcodes = await barcodeScanner.processImage(inputImage);
barcodeScanner.close();

Alternatives

Packages that do the same job and could replace google_mlkit_barcode_scanning.

  • mobile_scanner

    If you want a dedicated camera-view widget for continuous barcode scanning instead of processing custom input images.

  • qr_flutter

    If your only goal is generating QR codes rather than scanning them.

Works with

Packages commonly used together with google_mlkit_barcode_scanning: ones it builds on, ones built on it, and its own family.