CaptureService class abstract

On-device OCR, barcode scanning, and document-edge detection. Nothing ever leaves the device — Apple Vision (iOS) / ML Kit (Android) run locally, and the only thing that crosses the platform channel is the image bytes in and recognized data out.

Use FakeCaptureService in tests, or anywhere real native capture isn't available/needed (e.g. a simulator where barcode detection doesn't run).

Implementers

Constructors

CaptureService()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

detectDocumentRect(Uint8List imageBytes) → Future<DocumentRect?>
Detect a document/card in the image and return its bounding box (to seed a confirm-crop UI), or null when none is found / the platform can't. A caller should let the user confirm or adjust the rectangle before any crop is applied — this is a hint, never an automatic crop. Default no-op for fakes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recognize(Uint8List imageBytes) → Future<OcrResult>
recognizeBarcodes(Uint8List imageBytes) → Future<List<String>>
Decode 2D barcodes from the image — chiefly a driver license's PDF417 (its AAMVA payload, see Aamva.parse). Returns the raw payload strings, or [] when there are none / the platform can't. Default no-op so fakes need not implement it.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited