qr_barcode_scanner library
QR Code AI Scanner — QR decoding + scannability scoring for artistic / AI-generated QR codes (the ones that break standard scanners). Native Rust core via flutter_rust_bridge.
import 'package:qr_barcode_scanner/qr_barcode_scanner.dart';
await QrcodeAiScanner.init(); // once, before any scan
final report = await QrcodeAiScanner.scan(pngBytes);
final text = report.detections.isEmpty
? 'no QR'
: report.detections.first.content.text; // typed, no JSON wrangling
Classes
- AlphaEnvelope
- The placement envelope — over which backgrounds the transparent design keeps decoding. Every reported endpoint is a TESTED background.
- AlphaPaletteProbe
-
One HOST-requested palette probe (
alpha_paletteconfig). - AlphaProbe
- One neutral-background decode probe of the placement envelope.
- AlphaReport
-
How transparency was handled — absent for opaque inputs and under
alphaBackground: "none"(the report then carries no block at all). - AxisScore
- DecodedContent
- One exact reading of a symbol's data — compare contents by identity (symbology, raw, fnc1, compatible eci), never by text.
- Detection
- EciSegment
- One ECI designator (ISO/IEC 18004 §7.4.2): number 0–999999 and byte offset into raw (-1 if missing).
- Gs1Element
- Hint
- A machine-actionable improvement hint. Unknown hints decode to HintUnknown.
- HintAddBackgroundPlate
- HintAlphaBackgroundDependent
- HintEnlargeModules
- HintFixFinderPattern
- HintIncreaseContrast
- HintLowCorrectionMargin
- HintRaiseErrorCorrection
- HintReduceArtTexture
- HintRestoreQuietZone
- HintUnknown
- Iso15415Report
- IsoParameter
- Occurrence
- One physical copy of a detection's content.
- OccurrenceGeometry
- What a reader measured of one symbol, in stored-pixel image coordinates (y down) — never completed, extended or reconstructed. A quad is clockwise; for the QR family its first point is the symbol's origin corner in every rotation, mirrored or not.
- Payload
-
Typed payload classification. Unknown
kinds decode to PayloadUnknown (never a throw) — the schema mandates additive tolerance. - PayloadCrypto
- PayloadEmail
- PayloadGeo
- PayloadGs1
- PayloadGs1DigitalLink
- PayloadMeCard
- PayloadSms
- PayloadTel
- PayloadText
- PayloadUnknown
-
A
kindthis binding version doesn't model — keeps the raw map so callers can still read it. Forward-compatible by construction. - PayloadUrl
- PayloadVCard
- PayloadVEvent
- PayloadWifi
- PipelineTrace
- Point
- QrcodeAiScanner
- The QR scanner. One Rust core, the same versioned ScanReport as the Python / Node / WASM / Kotlin / Swift bindings (one serde wire contract).
- QrMeta
- RustLib
- Main entrypoint of the Rust API
- Saturation
- A true flag: what that capacity left out is unknown, not absent.
- ScanReport
- Score
- StageTrace
- StructuralReport
- UecReport
- Versions
Enums
- AlphaMode
- The requested alpha-background handling (config echo).
- AlphaPlacement
- Placement verdict spelled by the envelope's decoded bands.
- Charset
- How DecodedContent.text relates to DecodedContent.raw (spec/01 § Content). unknown is the only lossy value, forever; every other value, unrecognized included, is a complete decoding the scanner checked (the declared interpretation only when DecodedContent.eci lists it).
- EcLevel
- EngineKind
- Fnc1Position
- FNC1 position: first GS1 mode; second AIM application mode (raw starts with the application indicator).
- GeometryKind
- What an occurrence's points are (spec/01 § Occurrences). Later versions may add kinds: they read as unknown.
- Grade
- The 0–100 scannability band.
- LetterGrade
-
ISO 15415 / UEC letter grade (A…F). Shared by
UecReport.grade,Iso15415Report.overall, and eachIsoParameter.grade. - StressAxis
- Symbology