Loading repository data…
Loading repository data…
microblink / repository
ID scanning plugins for cross-platform apps built with Flutter.
The BlinkID SDK is a comprehensive solution for implementing secure document scanning on the Flutter cross-platform. It offers powerful capabilities for capturing and analyzing a wide range of identification documents. The Flutter plugin consists of BlinkID, which serves as the core module, and the BlinkIDUX package that provides a complete, ready-to-use solution with a user-friendly interface.
Please note that, for maximum performance and full access to all features, it’s best to go with one of our native SDKs (for iOS or Android).
However, since the wrapper is open source, you can add the features you need on your own.
A valid license key is required to initialize the BlinkID plugin. A free trial license key can be requested after registering at the Microblink Developer Hub.
| Requirement | Flutter | iOS | Android |
|---|---|---|---|
| OS/API version | Flutter 3.44 and newer | iOS 16.0 and newer | API level 24 and newer |
| Compile SDK version | — | — | 36 and newer |
| Kotlin version | — | — | 2.2.21 and newer |
| AGP version | — | — | 9.1.0 and newer |
| Camera quality | — | At least 1080p | At least 1080p |
See Plugin integration for more details.
For additional help with the Flutter setup, view the official documentation.
For more detailed information about the BlinkID Android and iOS requirements, view the native SDK documentation here (Android & iOS).
The sample application demonstrates how the BlinkID plugin is implemented and how to obtain scanned results. It contains the implementation for:
performScan) — default BlinkID UX with configurable scanning modules.The sample UI lets you toggle and configure each scanning module (Document Capture, Barcode, MRZ, VIZ), session timeouts, UX options, class filter, and redaction — the same settings you would configure in your own app.
To obtain and run the sample application, follow the steps below:
git clone https://github.com/microblink/blinkid-flutter.git
initBlinkIdFlutterSample.sh script:cd blinkid-flutter && ./initBlinkIdFlutterSample.sh
sample folder and run the flutter run command:cd sample && flutter run
Note: the plugin can be run directly via Xcode (iOS) and Android Studio (Android):
Runner.xcodeproj in the path: sample/ios/Runner.xcodeproj to run the iOS sample application.android folder via Android Studio in the sample folder to run the Android sample application.Sample app on iOS additional instructions
Module 'blinkid-flutter' not foundIf you are getting the error above when running the sample application, this usually means that support for Swift Package Manager was not enabled in the Flutter configuration. Simply run the following command to enable it:
flutter config --enable-swift-package-manager
After this, try to run the sample application again.
FlutterGeneratedPluginSwiftPackage has a lower minimum deployment targetTo resolve the issue with the minimum deployment target for the FlutterGeneratedPluginSwiftPackage package, do the following:
flutter build ios --config-only
This should properly configure the minimum deployment target of the package.
flutter create project_name
The native BlinkID iOS SDK is distributed via Swift Package Manager. Enable Flutter SPM support:
flutter config --enable-swift-package-manager
Add blinkid_flutter to your pubspec.yaml:
dependencies:
...
blinkid_flutter: ^8000.0.0
Then install:
flutter pub get
The BlinkID SDK requires API level 24 or newer. In android/app/build.gradle.kts:
android {
defaultConfig {
minSdk = 24
}
}
In android/settings.gradle.kts, update the Android Gradle Plugin (AGP) and Kotlin versions to match BlinkID requirements:
id("com.android.application") version "9.1.0" apply false
id("org.jetbrains.kotlin.android") version "2.2.21" apply false
No Jetpack Compose setup is required in your app. The plugin uses BlinkID's Activity-based scanning flow (MbBlinkIdScan); Compose runtime libraries are resolved transitively through the plugin. If your app already uses Compose for its own UI, you can keep your existing Compose configuration — the plugin does not declare a Compose BOM.
Set the minimum iOS deployment target to 16.0 in your Xcode project (or ios/Podfile / IPHONEOS_DEPLOYMENT_TARGET in xcconfig files).
Add the following keys to ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera access is required for BlinkID document scanning</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo library access is required for BlinkID DirectAPI scanning</string>
After changing the deployment target, run:
flutter build ios --config-only
import 'package:blinkid_flutter/blinkid_flutter.dart';
final blinkIdPlugin = BlinkIdFlutter();
import 'dart:io';
// Platform-specific license key
var sdkLicenseKey = "";
if (Platform.isAndroid) {
sdkLicenseKey = "android-license-key";
} else if (Platform.isIOS) {
sdkLicenseKey = "ios-license-key";
}
// SDK initialization settings
final sdkSettings = BlinkIdSdkSettings(
licenseKey: sdkLicenseKey,
downloadResources: true
);
// Scanning modules — enable only what your use case needs, for example
final scanningSettings = BlinkIdScanningSettings(
documentCaptureModule: DocumentCaptureModuleSettings(
documentImageReturnEnabled: true,
faceImageExtractionEnabled: true,
inputImageReturnEnabled: false,
),
mrzModule: MrzModuleSettings(),
barcodeModule: BarcodeModuleSettings(),
vizModule: VizModuleSettings(
signatureImageExtractionEnabled: true,
),
);
// Session settings
final sessionSettings = BlinkIdSessionSettings(
scanningMode: ScanningMode.automatic,
scanningSettings: scanningSettings,
stepTimeoutDuration: 60000, // ms per scanning step (0 = no timeout)
inactivityTimeoutDuration: 10000, // ms of UI inactivity (0 = disabled)
);
// Optional UX customization (camera scanning only)
final uxSettings = BlinkIdScanningUxSettings(
showHelpButton: true,
showOnboardingDialog: true,
allowHapticFeedback: true,
preferredCamera: PreferredCamera.back,
);
// Optional document class filter
final classFilter = ClassFilter()
..includeDocuments = [
DocumentFilter(country: Country.usa),
DocumentFilter(
country: Country.usa,
region: Region.california,
documentType: DocumentType.id,
),
];
Tip: Set a module to
null(or omit it) to disable that module entirely. For example, an MRZ-only passport flow can useBlinkIdScanningSettings(mrzModule: MrzModuleSettings())with all other modules omitted.
try {
final result = await blinkIdPlugin.performScan(
blinkIdSdkSettings: sdkSettings,
blinkIdSessionSettings: sessionSettings,
blinkidScanningUxSettings: uxSettings,
classFilter: classFilter,
redactionSettingsResolver: redactionSettingsResolver
);
if (result != null) {
print(result.firstName?.value);
print(result.firstDocumentImage); // Base64, if document capture returned images
}
} on PlatformException catch (e) {
print("BlinkID scanning error: ${e.message}");
}
final result = await blinkIdPlugin.performDirectApiScan(
blinkIdSdkSettings: sdkSettings,
blinkIdSessionSettings: sessionSettings,
firstImage: frontImageBase64,
secondImage: backImageBase64, // optional; required for automatic two-sided scan
);
sample_files/main.dart.sample_files/scanning_modules_config.dart.sample_files/blinkid_result_builder.dart.In v8000, scanning behavior is controlled through four independent modules configured on BlinkIdScanningSettings:
| Module | Class | Purpose |
|---|---|---|
| Document Capture | DocumentCaptureModuleSettings | Document detection, cropping, image quality checks (blur, glare, tilt, lighting, hand occlusion), face image extraction, and document image return. |
| MRZ | MrzModuleSettings | Machine Readable Zone detection and parsing (passports, visas, ID cards). |
| Barcode | BarcodeModuleSettings | 1D/2D barcode detection and parsing (PDF417, QR, retail codes, etc.). Can run standalone or alongside document capture. |
| VIZ | VizModuleSettings | Visual Inspection Zone field extraction, character validation, signature image extraction, and multi-frame result aggregation. |
Full ID scan (default-like behavior) — enable all four modules:
BlinkIdScanningSettings(
documentCaptureModule: DocumentCaptureModuleSettings(),
mrzModule: MrzModuleSettings(),
barcodeModule: BarcodeModuleSettings(),
vizModule: VizModuleSettings(),
)
Passport MRZ only:
BlinkIdScanningSettings(
documentCaptureModule: DocumentCaptureModuleSettings(
passportDataPageScanOnly: true,
),
mrzModule: MrzModuleSettings(),