Android Flutter Wrapper

Integrate IDmission's IDentity SDK into your Android Flutter application.

Prerequisites

  • Flutter 3.38.0 or later — Flutter installation guide →
  • Java 17 — the plugin compiles with sourceCompatibility JavaVersion.VERSION_17; use JDK 17 or newer
  • Android Gradle Plugin 8.11.1 or later
  • Kotlin 2.2.20 or later
  • minSdk 26 (Android 8.0) — required by the IDmission native SDK
Flutter template variables: flutter create generates compileSdk = flutter.compileSdkVersion, minSdk = flutter.minSdkVersion, and targetSdk = flutter.targetSdkVersion. Replace all three with the hardcoded values shown in Step 2 — the plugin requires exact versions.

Setup

  1. 1

    Add the plugin as a git dependency in your app's pubspec.yaml, then fetch it.

    YAML
    dependencies:
      flutter:
        sdk: flutter
    
      flutter_plugin_identity_sdk:
        git:
          url: https://github.com/Idmission-LLC/SDK2Flutter.git
          ref: v11.1.19
          path: flutter_plugin_identity_sdk
    Shell
    flutter pub get
  2. 2

    Configure SDK versions, Java compatibility, and multidex in your app-level build file.

    app/build.gradle
    android {
        compileSdkVersion 36
    
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_17
            targetCompatibility JavaVersion.VERSION_17
        }
    
        kotlinOptions {
            jvmTarget = "17"
        }
    
        defaultConfig {
            minSdkVersion 26
            targetSdkVersion 36
            multiDexEnabled true
        }
    }
    app/build.gradle.kts
    android {
        compileSdk = 36
    
        compileOptions {
            sourceCompatibility = JavaVersion.VERSION_17
            targetCompatibility = JavaVersion.VERSION_17
        }
    
        kotlinOptions {
            jvmTarget = JavaVersion.VERSION_17.toString()
        }
    
        defaultConfig {
            minSdk = 26
            targetSdk = 36
            multiDexEnabled = true
        }
    }
  3. 3

    Add the IDmission Maven repository to your project-level build file.

    Kotlin DSL only: Place repos inside allprojects { repositories { } }. Do not use dependencyResolutionManagement.repositories — Flutter's Gradle plugin uses includeBuild, which is incompatible with it.
    build.gradle
    allprojects {
        repositories {
            google()
            mavenCentral()
            maven {
                url "https://gitlab.idmission.com/api/v4/projects/220/packages/maven"
                name "GitLab"
                credentials(HttpHeaderCredentials) {
                    name = "Private-Token"
                    value = "WESesyuSD9fQeqNEyig6"
                }
                authentication {
                    header(HttpHeaderAuthentication)
                }
            }
            maven { url 'https://jitpack.io' }
        }
    }
    build.gradle.kts
    allprojects {
        repositories {
            google()
            mavenCentral()
            maven {
                url = uri("https://gitlab.idmission.com/api/v4/projects/220/packages/maven")
                name = "GitLab"
                credentials(HttpHeaderCredentials::class) {
                    name = "Private-Token"
                    value = "WESesyuSD9fQeqNEyig6"
                }
                authentication {
                    create<HttpHeaderAuthentication>("header")
                }
            }
            maven { url = uri("https://jitpack.io") }
        }
    }
  4. 4

    Connect a physical Android device and run the application.

    Shell
    flutter run
    The IDentity SDK requires a physical device — the Android Emulator does not support camera capture and will not run the SDK flows.

Available Functions

Import the package and follow this pattern for every service call:

Dart — usage pattern
import 'package:flutter_plugin_identity_sdk/flutter_plugin_identity_sdk.dart';

// 1. Initialise once before calling any service
await FlutterPluginIdentitySdk.idm_sdk_init(apiBaseUrl, 'n', accessToken);

// 2. Call a service
final result = await FlutterPluginIdentitySdk.idm_sdk_serviceID10('y', 12345);

// 3. Submit the result
await FlutterPluginIdentitySdk.submit_result();
Initidm_sdk_init

Initializes the SDK. Must be called before any other function. Returns “SDK Successfully Initialized” on success (the same text on iOS and Android), or “Error” / an error message on failure.

Dart
await FlutterPluginIdentitySdk.idm_sdk_init(
  String apiBaseUrl,   // API base URL — provided by IDmission
  String debug,        // 'y' turns on verbose SDK logging; use 'n' in production
  String accessToken,  // your IDmission access token
  // Optional named parameters — these are the defaults:
  String language = 'en',               // 'en' or 'es' (Android also 'my' and 'ar')
  bool enableGPS = true,                // capture GPS location with submissions
  bool geolocationRequired = false,     // block the flow if location access is denied
  bool isUpdateModelsData = true,       // download the latest SDK models after credential verification
  bool enableScreenRecording = false,   // allow screen recording / screenshots during capture
);
InfogetSDKInfo

Returns the SDK version and the names of the models in use. models is empty until the SDK has been initialized.

Dart
final info = await FlutterPluginIdentitySdk.getSDKInfo();
// info['version'] : SDK version
// info['models']  : [{'name': ..., 'value': ...}, ...]
Serviceidm_sdk_serviceID20

Initiates the ID Validation (Service ID 20) flow. Captures and validates a government-issued ID document.

Dart
await FlutterPluginIdentitySdk.idm_sdk_serviceID20(
  String captureBack,  // 'y' captures front and back, 'n' front only
  int clientTraceId,   // your unique integer trace ID for this transaction
);
await FlutterPluginIdentitySdk.submit_result();
Serviceidm_sdk_serviceID10

Initiates the ID Validation and Face Match (Service ID 10) flow. Captures an ID document and performs a liveness face match against the photo on the ID.

Dart
await FlutterPluginIdentitySdk.idm_sdk_serviceID10(
  String captureBack,  // 'y' captures front and back, 'n' front only
  int clientTraceId,   // your unique integer trace ID for this transaction
);
await FlutterPluginIdentitySdk.submit_result();
Serviceidm_sdk_serviceID185

Initiates the Identify Customer (Service ID 185) flow. Identifies an unknown individual against enrolled customer profiles.

Dart
await FlutterPluginIdentitySdk.idm_sdk_serviceID185();
await FlutterPluginIdentitySdk.submit_result();
Serviceidm_sdk_serviceID660

Initiates the Live Face Check (Service ID 660) flow. Performs liveness detection without document capture.

Dart
await FlutterPluginIdentitySdk.idm_sdk_serviceID660();
await FlutterPluginIdentitySdk.submit_result();
Serviceidm_sdk_serviceID50

Initiates the ID Validation and Customer Enrollment (Service ID 50) flow. Validates an ID document and enrolls the customer biometric profile.

Dart
await FlutterPluginIdentitySdk.idm_sdk_serviceID50(int uniqueCustomerNumber);
await FlutterPluginIdentitySdk.submit_result();
Serviceidm_sdk_serviceID175

Initiates the Customer Biometric Enrollment (Service ID 175) flow. Enrolls or updates a customer's biometric profile without document capture.

Dart
await FlutterPluginIdentitySdk.idm_sdk_serviceID175(int uniqueCustomerNumber);
await FlutterPluginIdentitySdk.submit_result();
Serviceidm_sdk_serviceID105

Initiates the Customer Verification (Service ID 105) flow. Verifies a returning customer against their enrolled biometric profile.

Dart
await FlutterPluginIdentitySdk.idm_sdk_serviceID105(int uniqueCustomerNumber);
await FlutterPluginIdentitySdk.submit_result();
Submitsubmit_result

Submits the captured data and finalizes the current service flow. Call after every service.

Dart
await FlutterPluginIdentitySdk.submit_result();

Upgrading from the zip install

If your app was set up from FlutterSDK2AndroidResources.zip, switch to the GitHub package. It replaces the files you copied from the zip.

  1. 1

    Delete your local copy of the plugin, usually the flutter_plugin_identity_sdk folder. In pubspec.yaml, replace its path: entry with the git entry from Step 1. Then run flutter clean and flutter pub get.

  2. 2

    If you copied CallPluginActivity.java or FlutterPluginIdentitySdkPlugin.java into your app, delete them. Also remove these from your app if you added them: the CallPluginActivity entry in AndroidManifest.xml and the idmission-mediumsdk dependency line in app/build.gradle. The plugin now adds all of these itself.

  3. 3

    Keep the IDmission Maven repository (Step 3). It has not changed.

  4. 4

    Your existing Dart code keeps working. Run your app on a device and test one service.