Android Flutter Wrapper

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

Setup

  1. 1

    Set up the Flutter development environment based on your development and target OS by following the official Flutter guide.

    Setting up the development environment →
  2. 2

    Verify that all Flutter dependencies are installed correctly.

    Shell
    flutter doctor
  3. 3

    Download and unzip the resources archive. It contains the android_java_code, android_build_gradle, and flutter_dart_code directories.

    Download FlutterSDK2AndroidResources →
  4. 4

    Run the following commands in your working directory to create the plugin template.

    Shell
    flutter create --template=plugin --org com.idmission.newsdkflutter --platforms=android,ios -a java -i swift flutter_plugin_identity_sdk
    cd flutter_plugin_identity_sdk
    cd example
    flutter pub upgrade
    dart migrate --apply-changes
  5. 5

    Connect an Android device and run the application to verify the base template works.

    Shell
    flutter run
  6. 6

    Add SDK files from the downloaded archive.

    • Android Java code: Copy the contents of android_java_code to android/src/main/java/com/idmission/newsdkflutter/flutter_plugin_identity_sdk. Overwrite files if required.
    • Android build gradle: Copy the contents of android_build_gradle to the android folder. Overwrite if required.
    • Flutter Dart code: From flutter_dart_code, copy flutter_plugin_identity_sdk.dart to the lib folder, and main.dart to example/lib. Overwrite if required.
  7. 7

    Modify the Android plugin project. Open the android folder. In AndroidManifest.xml, add the following inside the <manifest> node.

    XML
    <application>
      <activity android:name="com.idmission.newsdkflutter.flutter_plugin_identity_sdk.CallPluginActivity"/>
    </application>
  8. 8

    Modify the Android app project. Open the example/android folder and apply the following changes.

    app/build.gradle

    Update the SDK versions in defaultConfig.

    Gradle
    minSdkVersion 26
    targetSdkVersion 36

    src/main/AndroidManifest.xml

    Add the tools namespace to the <manifest> node.

    XML
    xmlns:tools="http://schemas.android.com/tools"

    Add the following theme to the <application> node.

    XML
    android:theme="@style/Theme.MaterialComponents.Light.NoActionBar"

    Add the following theme to the <activity> node.

    XML
    android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar"
  9. 9

    Open the Android app project in Android Studio by opening example/android.

  10. 10

    Build and run the code on an Android device.

    Shell
    flutter build apk --target-platform android-arm64 --split-per-abi --release

Available Functions

The following functions are available after initializing the SDK.

Init idm_sdk_init

Initializes the SDK. Must be called before any other function.

Dart
idm_sdk_init(String apiBaseUrl, String debug, String accessToken)
Service idm_sdk_serviceID20

Initiates the ID Validation (Service ID 20) flow.

Dart
idm_sdk_serviceID20()
Service idm_sdk_serviceID10

Initiates the ID Validation and Match Face (Service ID 10) flow.

Dart
idm_sdk_serviceID10()
Service idm_sdk_serviceID185

Initiates the Identify Customer (Service ID 185) flow.

Dart
idm_sdk_serviceID185()
Service idm_sdk_serviceID660

Initiates the Live Face Check (Service ID 660) flow.

Dart
idm_sdk_serviceID660()
Service idm_sdk_serviceID50

Initiates the ID Validation and Customer Enroll (Service ID 50) flow.

Dart
idm_sdk_serviceID50(int uniqueCustomerNumber)
Service idm_sdk_serviceID175

Initiates the Customer Enroll Biometrics (Service ID 175) flow.

Dart
idm_sdk_serviceID175(int uniqueCustomerNumber)
Service idm_sdk_serviceID105

Initiates the Customer Verification (Service ID 105) flow.

Dart
idm_sdk_serviceID105(int uniqueCustomerNumber)
Submit submit_result

Submits the form and finalizes the current service flow.

Dart
submit_result()