flutter_card_scanner_plus library

On-device bank card scanner for Flutter.

Recognizes Visa, Mastercard, American Express, Discover, JCB, Diners Club and UnionPay cards using the platform OCR engine (Vision on iOS, ML Kit on Android). Frames never leave the device.

Classes

CameraHandle
Returned by CardScannerPlatform.start.
CardFrameOverlay
Default overlay: dimmed background with a card-shaped cutout, corner brackets that turn successColor as fields are recognized, a prompt saying what the scanner is still looking for, and the fields found so far.
CardFrameParser
Turns raw OCR lines from one frame into card fields.
CardholderName
A printed cardholder name split into the parts a payment form asks for.
CardScanner
Static entry points that don't need a live camera.
CardScannerController
Drives the camera and OCR pipeline and exposes results.
CardScannerPage
Ready-made full-screen scanner. Pops with the CardScanResult once complete, or null if dismissed.
CardScannerPlatform
Contract implemented by the native side. Replace instance in tests.
CardScannerState
Snapshot of the scanner, exposed through CardScannerController.value.
CardScannerStrings
Every piece of text the built-in scanner UI can show.
CardScannerView
Camera preview with a card-shaped scanning frame.
CardScanResult
Result of a card scan. Fields are null until recognized.
ExpiryCandidate
An expiry date found in OCR output.
ExpiryParser
Extracts MM/YY and MM/YYYY dates from OCR text.
FrameAggregator
Accumulates per-frame parse results and emits a CardScanResult once values have been confirmed across several frames.
FrameParseResult
Everything extracted from a single OCR frame. Any field may be null.
Luhn
Luhn (mod 10) checksum used by all major card networks.
NameCandidate
A cardholder name found in OCR output.
NameParser
Extracts the cardholder name from OCR text lines.
PanCandidate
A primary account number found in OCR output.
PanParser
Extracts card numbers from OCR text lines.
RecognizedFrame
All text recognized in one camera frame.
ScanRequirements
Controls which fields are needed and when a scan is considered complete.
ScanSession
Turns a stream of parsed frames into one result.
TextBox
Axis-aligned bounding box in normalized image coordinates (0..1), origin at the top-left corner of the analyzed image.
TextLine
A single line of text produced by the platform OCR engine.

Enums

CardBrand
Card networks the scanner recognizes.
CardField
A field the scanner can extract from a card.

Typedefs

CardScannerOverlayBuilder = Widget Function(BuildContext context, CardScannerState state, Rect cardRect)
Builds the UI drawn on top of the camera preview.

Exceptions / Errors

CardScannerException
Error raised by the native camera/OCR layer.