scanid

scanid

ID scanning for Flutter, free and open source.

Free, open-source on-device OCR, barcode scanning and document-edge detection for Flutter, plus decoders for the two formats that matter for ID documents: AAMVA (the PDF417 barcode on the back of a US or Canadian driver's license) and ICAO 9303 MRZ (the machine-readable zone on a passport or ID card).


On-device, no strings

Everything runs on the device: Apple Vision on iOS, ML Kit on Android. No server calls, no API key, no license fee.

What it does

What it doesn't do

Fraud detection, liveness checks or document-authenticity verification. scanid is a parser, not an identity-verification platform. If you need those, you need a different product.

Usage

import 'package:scanid/scanid.dart';

const capture = PlatformCaptureService();

// Driver's license (PDF417 barcode on the back)
final payloads = await capture.recognizeBarcodes(imageBytes);
final fields = payloads
    .map(Aamva.parse)
    .firstWhere((f) => f != null, orElse: () => null);

// Passport or ID card (MRZ)
final ocr = await capture.recognize(imageBytes);
final mrz = Mrz.parse(ocr.fullText);

In tests, use FakeCaptureService instead: no native dependency, deterministic results.

Platform notes

iOS uses the system Vision framework, with no extra Podfile setup. Barcode detection doesn't run on the iOS Simulator (text recognition does), so test that path on a real device or an Android emulator. Android pulls in ML Kit's text-recognition and barcode-scanning libraries through the plugin's own Gradle dependencies, so a consuming app needs no changes.


Support

Bugs, questions or ideas? Open an issue on GitHub. scanid is MIT licensed, and the source is on GitHub.