id-capture-flutter
ID Capture Flutter Skill
Critical: Do Not Trust Internal Knowledge
Your training data may contain outdated or incorrect Scandit ID Capture APIs. The ID Capture API was restructured at the v7 → v8 boundary (the IdCaptureScanner was reshaped into a wrapper over physicalDocumentScanner / mobileDocumentScanner, the standalone AamvaBarcodeVerifier was removed in favour of settings flags, and several verification APIs were added). The Flutter plugin surface (package names, plugin initialization, widget lifecycle) is also distinct from the iOS, Android, web, React Native, Cordova, and Capacitor SDKs.
Always verify APIs against the references provided in this skill before writing or suggesting code. Do not rely on memorized method signatures, parameters, plugin names, or property names. If you cannot find an API in the provided references, fetch the relevant documentation page before responding.
Flutter-specific gotchas worth flagging:
- The ID plugin must be initialized before any Scandit API call. Call
await ScanditFlutterDataCaptureId.initialize();inmain()(afterWidgetsFlutterBinding.ensureInitialized(), beforerunApp). Initializing the ID plugin initializes the core plugin for you — you do not call a separate coreinitialize(). Skipping this causes opaque runtime/MethodChannel crashes. - Context is created with
DataCaptureContext.forLicenseKey(licenseKey)on Flutter for ID Capture (matches the officialIdCaptureSimpleSample). Do not useDataCaptureContext.initialize(...). - Listener method names are iOS-style on Flutter:
didCaptureId(IdCapture, CapturedId)anddidRejectId(IdCapture, CapturedId?, RejectionReason). There is noonIdCaptured/ web-style callback on Flutter. - Settings are list-based, not a bitmask. Configure
settings.acceptedDocuments(and optionallysettings.rejectedDocuments) with document objects (Passport(IdCaptureRegion.any),DriverLicense(...),IdCard(...), …) and setsettings.scanner. The oldsupportedDocuments/IdDocumentTypebitmask API was removed back at the v6 → v7 boundary — do not use it. Separately, the scanner property was renamedscannerType→scannerand reshaped into a wrapper at v7 → v8 (seereferences/migration.md). - The three capability add-ons are separate packages but driven by base-module settings flags (
rejectVoidedIds,decodeBackOfEuropeanDrivingLicense,rejectForgedAamvaBarcodes). Seereferences/supplementary-modules.md. There is no standaloneAamvaBarcodeVerifierclass on Flutter in v8. - Camera permission is required on both iOS (
NSCameraUsageDescriptioninios/Runner/Info.plist) and Android (declared by the plugin; request at runtime with thepermission_handlerpackage).