--- Source: https://docs.microblink.com/blinkcard/quickstart-flutter Title: Quickstart (Flutter) Description: Step-by-step guide to integrate BlinkCard Flutter SDK for credit card scanning in Flutter applications --- # Quickstart (Flutter) ## Prerequisites - License key: Get a trial or production key from the [Microblink Developer Hub](https://developer.microblink.com). Keys are bound to Android's Application ID, and iOS's Bundle Identifier. ### Flutter requirements - **Flutter version**: 3.29 and newer ### iOS requirements - **iOS version**: 16.0 and newer ### Android requirements - **Minimum SDK**: Android 7.0 (API 24) - **Kotlin version**: 2.1.20 - **Android Gradle Plugin**: Requires AGP 8.0+ ## Fast track: try the example app You can try the SDK by cloning the [blinkcard-flutter](https://github.com/BlinkCard/blinkcard-flutter) repository and running the BlinkCard example app. From the repo root, execute the example app script: ```bash git clone https://github.com/BlinkCard/blinkcard-flutter.git cd blinkcard-flutter ./initBlinkCardFlutterSample.sh ``` If you haven't enabled Swift Package Manager support for Flutter, this needs to be done prior to running the application as the BlinkCard iOS package is distributed this way. Run the following command: ```bash flutter config --enable-swift-package-manager ``` After the script has finished executing, go to the `sample` folder and run it via Flutter: ```bash cd sample flutter run ``` **Note**: the plugin can be run directly via Xcode (iOS) and Android Studio (Android): **iOS**: Open the Runner.xcodeproj in the path: sample/ios/Runner.xcodeproj to run the iOS sample application. **Android**: Open the android folder via Android Studio in the sample folder to run the Android sample application. ### Example application use-cases The example application demonstrates how the BlinkCard plugin is implemented, used and shows how to obtain the scanned results. It contains the implementation for: - The default implementation with the **default BlinkCard UX** scanning experience. - **Multiside DirectAPI scanning** - extracting the document information from multiple static images (from the gallery). - **Singleside DirectAPI scanning** - extracting the document information from a single static images (from the gallery). ## Install the SDK 1. To add the BlinkCard plugin to a Flutter project, first create empty project if needed: ```bash flutter create project_name ``` 2. Since the native BlinkCard iOS SDK is only distributed via Swift Package Manager, Flutter's Swift Package Manager support also needs to be enabled: ```bash flutter config --enable-swift-package-manager ``` 3. Add the blinkcard_flutter dependency to your `pubspec.yaml` file: ```yaml dependencies: ... blinkcard_flutter: ``` 4. Run the command to install the dependency: ```bash flutter pub get ``` ## Initialize and scan ### Import and create 1. Import the blinkcard_flutter package: ```dart import 'package:blinkcard_flutter/blinkcard_flutter.dart'; ``` 2. Initialize the BlinkCard plugin: ```dart /// Initialize the plugin final blinkCardPlugin = BlinkCardFlutter(); ``` 3. Create the `BlinkCardSdkSettings` object, and pass the license key: ```dart /// set the license key late String blinkCardLicenseKey; if (Platform.isAndroid) { blinkCardLicenseKey = "android-license-key"; } else if (Platform.isIOS) { blinkCardLicenseKey = "ios-license-key"; } final sdkSettings = BlinkCardSdkSettings(licenseKey: blinkCardLicenseKey); sdkSettings.downloadResources = true; ``` **You can get the license key on our [Developer Hub](https://developer.microblink.com) account.** 4. Pass the neccessary SDK settings: ```dart /// this was done in step 3. final sdkSettings = BlinkCardSdkSettings(licenseKey: blinkCardLicenseKey); sdkSettings.downloadResources = true; /// Create and modify the Session Settings final sessionSettings = BlinkCardSessionSettings(); /// Create and modify the scanning settings final scanningSettings = ScanningSettings(); scanningSettings.skipImagesWithBlur = true; scanningSettings.tiltDetectionLevel = DetectionLevel.mid; /// Create and modify the liveness settings final livenessSettings = LivenessSettings(); livenessSettings.enableCardHelpInHandCheck = true; livenessSettings.photocopyCheckStrictnessLevel = StrictnessLevel.level5; /// Create and modify the extraction settings final extractionSettings = ExtractionSettings(); extractionSettings.extractCardholderName = true; extractionSettings.extractCvv = true; extractionSettings.extractInvalidCardNumber = false; /// Create and modify the anonymization settings final anonymizationSettings = AnonymizationSettings(); anonymizationSettings.cardHolderNameAnonymizationMode = AnonymizationMode.imageOnly; anonymizationSettings.cvvAnonymizationMode = AnonymizationMode.fullResult; anonymizationSettings.cardNumberAnonymizationSettings = CardNumberAnonymizationSettings( prefixDigitsVisible: 1, suffixDigitsVisible: 2, ); /// Create and modify the cropped image settings final croppedImageSettings = CroppedImageSettings(); croppedImageSettings.returnCardImage = true; /// Place the above defined settings in the Scanning settings scanningSettings.extractionSettings = extractionSettings; scanningSettings.livenessSettings = livenessSettings; scanningSettings.anonymizationSettings = anonymizationSettings; scanningSettings.croppedImageSettings = croppedImageSettings; /// Place the Scanning settings in the Session settings sessionSettings.scanningSettings = scanningSettings; /// Create and modify the UX settings /// This paramater is optional final scanningUxSettings = ScanningUxSettings(); scanningUxSettings.showHelpButton = true; scanningUxSettings.showIntroductionAlert = false; scanningUxSettings.preferredCameraPosition = CameraPosition.back; scanningUxSettings.allowHapticFeedback = true; ``` 5. Call the appropriate scanning method (with the default UX, or DirectAPI for static images), handle the results and catch any errors: ```dart // Call the performScan method, where the SDK and session settings need to be passed // Here, you can also pass the optional ScanningUX object from step 4. final blinkCardResult = await blinkCardPlugin.performScan( blinkCardSdkSettings: sdkSettings, blinkCardSessionSettings: sessionSettings, scanningUxSettings: scanningUxSettings, ); print("${blinkCardResult.cardholderName}") ``` ### DirectAPI implementation For the DirectAPI (static image upload) implementation, see the example application [here](https://github.com/blinkcard/blinkcard-flutter/blob/main/sample_files/main.dart#L144). ## Additional documentation - Additional documentation for BlinkCard Flutter can be found in the README file on the official GitHub repository [here](https://github.com/blinkcard/blinkcard-flutter/blob/main/README.md). - The API documentation (methods, settings, results) can also be seen in the pub.dev documentation [here](https://pub.dev/documentation/blinkcard_flutter/latest/). Last updated on Apr 16, 2026