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).
Everything runs on the device: Apple Vision on iOS, ML Kit on Android. No server calls, no API key, no license fee.
recognize).recognizeBarcodes).detectDocumentRect).Aamva.parse: an AAMVA barcode payload into structured fields (name, date of birth, address, license class and more), handling real-world jurisdiction differences such as legacy single-field names, letter-coded sex, and CCYYMMDD versus MMDDCCYY dates.Mrz.parse: TD1, TD2 and TD3 MRZ into structured, check-digit-validated fields, with repair of the OCR mistakes real scanners produce on look-alike characters.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.
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.
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.
Bugs, questions or ideas? Open an issue on GitHub. scanid is MIT licensed, and the source is on GitHub.