Flutter QR Code Scanner SDK

Add offline QR code scanning to your Flutter app for Android and iOS. Install the MIT-licensed qr_barcode_scanner package from pub.dev, run native Rust decoding off the UI isolate via flutter_rust_bridge and inspect typed Dart reports.

Dart
import 'package:qr_barcode_scanner/qr_barcode_scanner.dart';

await QrcodeAiScanner.init();
final report = await QrcodeAiScanner.scan(imageBytes, profile: 'frame');
final codes = report.detections.where((d) => d.symbology == Symbology.qrCode);
final qr = codes.isEmpty ? null : codes.first;

print(qr?.content.text);

Inspect the decoded resulthttps://qrcode-ai.com/

Read saved QR images

Pass PNG, JPEG, WebP or GIF bytes to QrcodeAiScanner.scan() and receive a typed Dart ScanReport with URLs, text and QR diagnostics.

Shell
flutter pub add qr_barcode_scanner

Want to scan a code now? Open the online reader

Flutter QR Code Scanner SDK at a glance

  • Verified publisher qrcode-ai.com

    pub.dev

  • Native Rust via flutter_rust_bridge

    Android + iOS

  • Runs locally on Rust worker pool

    Off UI isolate

  • Open-source license

    MIT

Bring offline QR scanning to Flutter

Connect image pickers or camera RGBA frames to the native Rust engine on Android and iOS without blocking the UI isolate.

Read saved QR images

Pass PNG, JPEG, WebP or GIF bytes to QrcodeAiScanner.scan() and receive a typed Dart ScanReport with URLs, text and QR diagnostics.

Scan RGBA camera frames

Pass width*height*4 RGBA pixels to QrcodeAiScanner.scanFrame() on flutter_rust_bridge’s Rust worker pool while your app owns camera UI.

Typed Dart ScanReport

Read detections, a typed Payload sealed class, ISO 15415 / UEC grade cards, hints and trace.budgetExhausted with forward-safe enums.

Add QR image reading in Flutter

Add qr_barcode_scanner from pub.dev, initialize the native bridge once and decode image bytes asynchronously.

Add qr_barcode_scanner from pub.dev

Install qr_barcode_scanner on pub.dev under verified publisher qrcode-ai.com. Current releases include cargokit metadata so apps can download Ed25519-signed precompiled libraries for Android (4 ABIs) and iOS (devices and simulators) or compile from bundled Rust sources.

Platform toolchain note: iOS builds cleanly (with a Swift Package Manager warning only). On Android, current Flutter 3.50 toolchains that require AGP 9.1.1+ and Gradle 9.3.1+ fail inside cargokit because Gradle 9 removed Project.exec(); use a Gradle 8 Android toolchain or check the Flutter README for the Gradle 9 cargokit fix before upgrading.

Shell
flutter pub add qr_barcode_scanner

Without rustup installed, cargokit uses signed precompiled binaries by default. With rustup installed, add use_precompiled_binaries: true in cargokit_options.yaml next to pubspec.yaml to skip local Rust builds.

When building from source, install Rust 1.88+ and Android NDK r28+ (NDK r28 enforces 16 KB page alignment; NDK r27 produces 4 KB alignment).

Decode a QR image off the UI isolate

Call QrcodeAiScanner.init() once during app startup, then await QrcodeAiScanner.scan() with PNG, JPEG, WebP or GIF bytes. Decoding runs on flutter_rust_bridge’s worker pool so animations and gestures stay responsive.

Dart
import 'dart:typed_data';
import 'package:qr_barcode_scanner/qr_barcode_scanner.dart';

Future<List<String>> readQrImage(Uint8List imageBytes) async {
  await QrcodeAiScanner.init();
  final report = await QrcodeAiScanner.scan(
    imageBytes,
    profile: 'full',
  );
  if (report.trace.budgetExhausted == true) {
    return const [];
  }
  return report.detections
      .where((d) => d.symbology == Symbology.qrCode && !d.content.charset.isLossy)
      .map((d) => d.content.text)
      .toList();
}

Default budgets are full (4000 ms), fast (800 ms) and frame (80 ms); pass budgetMs: 0 for an unbounded scan, especially on slow debug simulators.

For live camera capture, call QrcodeAiScanner.scanFrame(rgba, width, height) with raw RGBA pixels while your app manages camera permissions and preview widgets.

Inspect the decoded result

For a QR image encoding https://qrcode-ai.com/, readQrImage resolves to ['https://qrcode-ai.com/']. Read report.score for QR quality grades (null means unmeasured, never zero).

No QR code found returns an empty detections list rather than throwing. Invalid image bytes throw an error containing [QRS-xxx]; negative budgetMs throws RangeError before calling native code.

Cargokit binaries, typed reports and simulator notes

Signed binaries and toolchains. Cargokit verifies Ed25519 signatures on precompiled libraries for Android (armeabi-v7a, arm64-v8a, x86, x86_64) and iOS before falling back to local compilation with Rust 1.88+ and Android NDK r28+.

Typed Dart models and budgets. ScanReport decodes additive fields forward-safely without throwing; check content.charset.isLossy before reading content.text, and use budgetMs: 0 if slow debug emulators trigger budgetExhausted.

App-owned UI and MIT license. Your Flutter app controls camera plugins, permissions and overlays. Current releases are MIT-licensed; see the Flutter binding README and Flutter API guide.

Flutter QR Code Scanner documentation and license

Official package documentation, ScanReport specification and licensing references.

Flutter QR Code Scanner SDK questions

pub.dev, precompiled libraries, NDK r28, UI isolate, budgets and licensing.

It is QR Code AI’s open-source MIT Flutter package (qr_barcode_scanner on pub.dev under verified publisher qrcode-ai.com) that connects Android and iOS Flutter apps to the native Rust engine via flutter_rust_bridge.

Not when signed precompiled binaries are available for your release. Without rustup, cargokit downloads and verifies Ed25519-signed libraries automatically; with rustup installed, set use_precompiled_binaries: true in cargokit_options.yaml or compile with Rust 1.88+ and Android NDK r28+.

No. The package handles native image and RGBA frame decoding only. Your Flutter app chooses its camera or image picker plugin, handles runtime permissions and renders previews or result actions.

Emulators and simulators run Flutter in debug mode on virtualized CPUs, where default fast (800 ms) or frame (80 ms) budgets can expire on shared runners. Pass budgetMs: 0 for unbounded scans during debugging and verify strict budgets on physical devices in release mode.

iOS builds and runs cleanly (displaying only a Swift Package Manager warning). On Android, projects using Flutter 3.50 with AGP 9.1.1+ and Gradle 9.3.1+ fail during compilation because cargokit still calls Project.exec(), which Gradle 9 removed; use a Gradle 8 Android toolchain or check the Flutter README for the Gradle 9 fix before targeting Gradle 9.

ScanReport is additively forward-compatible (unknown enum values map to unknown or unrecognized without throwing). An image with no code returns an empty detections list; unreadable files throw a message ending in [QRS-xxx].

No. Once built into your app, all decoding runs locally on the device off the Dart UI isolate, with no hosted API calls, no QR Code AI account and no creation credits.

Yes. Current releases are published under the MIT license, allowing commercial and proprietary use while preserving copyright and license notices (see LICENSING.md). SDK use is separate from QR Code AI’s paid creation plans and seven-day Premium trial.