qr_scanner_fast 0.0.2
qr_scanner_fast: ^0.0.2 copied to clipboard
A low-latency hybrid QR scanner that races ZXing with an ML Kit fallback.
Changelog #
All notable changes to this package are documented in this file.
0.0.1 #
Initial release of qr_scanner_fast.
Added #
- Native full-frame QR scanning for Android and iOS.
- A hybrid decoding strategy in which multiple decoders race and the first valid result wins.
- A live pipeline and a separate historical snapshot pipeline, both active from the moment the camera starts.
- A bounded in-memory snapshot buffer for checking QR codes that were visible only briefly while the camera or code was moving.
- Configurable frame sampling, snapshot sampling, fallback delay, decoder intervals, snapshot buffer size, duplicate cooldown, inverted-code attempts, and stop-after-detection behavior.
QrScannerFastControllerwith pause, resume, restart, torch, scanner status, and torch state controls.- A customizable scanner overlay that does not restrict the analyzed camera area.
QrScanResultwith the decoded payload, decoder engine, and timestamp.- A standalone isolate-based
ZxingQrDecoder.decodeLuminanceutility. - Camera permission handling for Android and iOS setup documentation.
- A complete example application, unit tests, and English documentation with architecture diagrams and performance guidance.
Android #
- Added a native CameraX preview and
ImageAnalysispipeline. - Added native ZXing and Google ML Kit QR decoding.
- Added independent executors for live ZXing, snapshot ZXing, and snapshot ML Kit so decoding does not block the camera analyzer.
- Added
KEEP_ONLY_LATESTbackpressure and capacity-one live ZXing queues to keep latency bounded. - Added sharpness scoring for historical snapshots. When the buffer is full, sharper recent frames can replace weaker frames.
- Added ML Kit potential-barcode detection and automatic zoom suggestions for QR codes that are visible but still too small to decode.
- Added potential-region mapping from ML Kit bounding boxes to priority ZXing crops with quiet-zone margins.
- Added a 1280x720 analysis target, continuous autofocus, and a preferred 30 FPS camera range when supported by the device.
- Added cleanup for CameraX bindings, ML Kit scanners, frame queues, permission waiters, method-channel handlers, and decoder executors when the platform view is disposed.
iOS #
- Added a native AVFoundation preview and video-output pipeline.
- Added Apple Vision as the primary live QR locator and decoder.
- Added native Google ML Kit live and historical-snapshot decoding.
- Added a bounded historical snapshot ring processed independently from the live stream.
- Added Vision candidate-region cropping with quiet-zone margins.
- Added an isolate-based Dart ZXing fallback for grayscale candidate regions; full camera frames remain on the native side.
- Added continuous autofocus, continuous exposure, a preferred 30 FPS capture rate, torch control, and camera-session lifecycle handling.
Changed #
- Replaced the original Flutter
camerapipeline with native CameraX on Android and AVFoundation on iOS. - Removed the Flutter
camera,google_mlkit_barcode_scanning, andgoogle_mlkit_commonsdependency chain. Native ML Kit SDKs remain integrated directly by each platform. - Removed obsolete Dart ML Kit worker code and unused camera configuration.
- Removed unused
loadingBuilder,startWithTorch, andQrScanResult.displayValueAPI members. - Simplified the Dart ZXing worker to accept tightly packed grayscale images, matching the active iOS ROI pipeline.
Requirements #
- Flutter 3.38.0 or newer.
- Dart 3.10.0 or newer.
- Android API 24 or newer.
- iOS 15.5 or newer.