Read saved QR images
Pass PNG, JPEG, WebP or GIF bytes to QrcodeAiScanner.scan() and get a typed Dart ScanReport with URLs, text and QR diagnostics.
pub.dev
Android + iOS
Off UI isolate
MIT
Connect image pickers or camera RGBA frames to the native Rust engine on Android and iOS without blocking the Flutter UI isolate.
Pass PNG, JPEG, WebP or GIF bytes to QrcodeAiScanner.scan() and get a typed Dart ScanReport with URLs, text and QR diagnostics.
Pass width*height*4 RGBA pixels to QrcodeAiScanner.scanFrame() on flutter_rust_bridge’s Rust worker pool while your app owns camera UI.
Inspect detections, a typed Payload sealed class, ISO 15415 / UEC grade cards, hints and trace.budgetExhausted with forward-safe enums.
Add qr_barcode_scanner from pub.dev, initialise the native bridge once and decode image bytes asynchronously.
Install qr_barcode_scanner on pub.dev under verified publisher qrcode-ai.com. Current releases ship 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 (showing only a Swift Package Manager warning). On Android, current Flutter 3.50 toolchains requiring AGP 9.1.1+ and Gradle 9.3.1+ fail inside cargokit because Gradle 9 removed Project.exec(); stay on a Gradle 8 Android toolchain or check the Flutter README for the Gradle 9 cargokit fix before upgrading.
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 beside 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).
Call QrcodeAiScanner.init() once at 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 touch gestures stay smooth.
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 slower debug simulators.
For live camera capture, call QrcodeAiScanner.scanFrame(rgba, width, height) with raw RGBA pixels while your app handles camera permissions and preview widgets.
For a QR image encoding https://qrcode-ai.com/, readQrImage resolves to ['https://qrcode-ai.com/']. Check report.score for QR quality grades (null means unmeasured, never zero).
When no QR code is found, the SDK 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.
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 parses additive fields forward-safely without throwing; verify content.charset.isLossy before reading content.text, and pass budgetMs: 0 if slow debug emulators hit budgetExhausted.
App-owned UI and MIT licence. Your Flutter app manages camera plugins, permission dialogues and overlays. Current releases are MIT-licensed; see the Flutter binding README and Flutter API guide.
Official package documentation, ScanReport specification and licensing references.
pub.dev, precompiled libraries, NDK r28, UI isolate, budgets and licensing.
It is QR Code AI’s open-source MIT-licensed 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 through flutter_rust_bridge.
Not when signed precompiled binaries are available for your release. Without rustup on your laptop, cargokit downloads and verifies Ed25519-signed libraries automatically; if rustup is 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 selects its own camera or image picker plugin, manages runtime permission dialogues and renders previews or result actions.
Emulators and simulators execute Flutter in debug mode on virtualised CPUs, where default fast (800 ms) or frame (80 ms) budgets can expire on shared machines. Pass budgetMs: 0 for unbounded scans while debugging and verify strict budgets on physical phones 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; stay on 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 an error message ending in [QRS-xxx].
Yes. Once compiled into your app, all decoding runs locally offline on the device off the Dart UI isolate, with no hosted API calls, no API key, no QR Code AI account and no creation credits.
Yes. Current releases are published under the MIT licence, permitting commercial and proprietary Flutter mobile apps while retaining copyright and licence notices (see LICENSING.md). SDK use is independent of QR Code AI’s paid creation plans and seven-day Premium trial.