enroll_plugin 1.5.0 copy "enroll_plugin: ^1.5.0" to clipboard
enroll_plugin: ^1.5.0 copied to clipboard

eNROLL is a compliance solution that prevents identity fraud and phishing. Powered by AI, it reduces errors and speeds up identification, ensuring secure verification.

eNROLL #

Our in-house developed eNROLL platform serves as a technological compliance solution. A solution that is now familiarized across the globe in countries with big populations, where falsification of identity, signatures, and phishing is very common.

The software utilizes a set of AI-powered technologies, like the OCR (Optical Character Recognition), to cut back on the risks of human-based errors and the time needed for identification.

REQUIREMENTS #

  • Minimum Flutter version 3.3.4
  • Android minSdkVersion 24
  • Kotlin Version 2.1.0
  • iOS Deployment Target 13.0+

2. INSTALLATION #

1- Run this command with Flutter:

$ flutter pub add enroll_plugin

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  enroll_plugin: ^latest_version

2.1. Android #

  • Add these lines to build.gradle file:
maven { url 'https://jitpack.io' }
maven { url = uri("https://maven.innovatrics.com/releases") }
  • Upgrade minSdkVersion to 24 in app/build.gradle.
  • Add the following lines to settings.gradle file:
buildscript {
    repositories {
        mavenCentral()
        maven {
            url = uri("https://storage.googleapis.com/r8-releases/raw")
        }
    }
    dependencies {
        classpath("com.android.tools:r8:8.2.24")
    }
}

2.2. iOS #

  • Add the following to your project info.plist file
<key>NSCameraUsageDescription</key>
<string>"Your Message to the users"</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>"Your Message to the users"</string>
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
  • Add these two sources to the iOS project Podfile
source 'https://github.com/innovatrics/innovatrics-podspecs'
source 'https://github.com/LuminSoft/eNROLL-iOS-specs'
source 'https://github.com/CocoaPods/Specs.git'

2.3. Add a license file to your project: #

  • For Android

App Screenshot

  • For iOS

App Screenshot

ℹ️ Make sure your iOS project has a reference for the license file or instead:

  • open iOS project
  • Drag and drop the license file to the root folder of the project as described above
  • make sure to copy items if needed, check the box is checked
  • then done

2.4. Run Command line: #

flutter pub get

3. IMPORT #

import 'package:enroll_plugin/enroll_plugin.dart';

4. USAGE #

  • Create a widget and just return the EnrollPlugin widget in the build function as:
return EnrollPlugin(
    mainScreenContext: context,
    tenantId: 'TENANT_ID',
    tenantSecret: 'TENANT_SECRET',
    enrollMode: EnrollMode.onboarding,
    enrollEnvironment: EnrollEnvironment.staging,
    localizationCode: EnrollLocalizations.en,
    onSuccess: (applicantId) {
      WidgetsBinding.instance.addPostFrameCallback((_) {
        debugPrint("success: $applicantId");
      });
    },
    onError: (error) {
      WidgetsBinding.instance.addPostFrameCallback((_) {
        debugPrint("Error: ${error.toString()}");
      });
    },
    onGettingRequestId: (requestId) {
      WidgetsBinding.instance.addPostFrameCallback((_) {
        debugPrint("requestId:: $requestId");
      });
    },
    applicationId: 'APPLICATION_ID',
    levelOfTrustToken: 'LEVEL_OF_TRUST_TOKEN',
    googleApiKey: 'GOOGLE_API_KEY',
    correlationId: 'correlationId',
    requestId: 'requestId',
    skipTutorial: false,
    appColors: EnrollColors(
      primary: Color(0xFF000000),
      secondary: Color(0xFFFFFFFF),
      appBackgroundColor: Color(0xFFF8F8F8),
      successColor: Color(0xFF4CAF50),
      warningColor: Color(0xFFFFC107),
      errorColor: Color(0xFFF44336),
      textColor: Color(0xFF212121),
    ),
    enrollForcedDocumentType: EnrollForcedDocumentType.nationalIdOrPassport,
    templateId: 'templateId',
    contractParameters: 'contractParameters',
    exitStep: EnrollStepType.phoneOtp
);

4.1. Icon Customization #

You can fully replace the SDK's default logo, step illustrations, popup glyphs, field icons, and UI icons by passing an EnrollTheme to EnrollPlugin.

The EnrollTheme parameter takes priority over enrollColors.

If you only need to customize colors, you can continue using enrollColors.


4.1.1. Android Icon Customization #

Step 1: Add your custom drawables #

Place your PNG/XML drawables inside:

android/app/src/main/res/drawable/

Example:

example/android/app/src/main/res/drawable/my_logo.png
example/android/app/src/main/res/drawable/my_location_icon.xml

Reference them by name (without extension) using EnrollStepIcon.assetName.

Step 2: Build an EnrollTheme #

final EnrollTheme myTheme = EnrollTheme(
  colors: EnrollColors(
    primary: const Color(0xFF1D56B8),
    secondary: const Color(0xFF5791DB),
  ),
  icons: const EnrollIcons(
    logo: EnrollLogoConfig(
      mode: EnrollLogoMode.custom,
      assetName: 'my_logo',
      renderingMode: EnrollIconRenderingMode.original,
    ),
    location: EnrollLocationIcons(
      tutorial: EnrollStepIcon(assetName: 'my_location_icon'),
    ),
    common: EnrollCommonIcons(
      termsAndConditions: EnrollStepIcon(assetName: 'my_terms_icon'),
      popups: EnrollPopupIcons(
        successIcon: EnrollStepIcon(assetName: 'my_success_icon'),
      ),
    ),
  ),
);

Step 3: Pass it to the plugin #

EnrollPlugin(
  // ...other parameters...
  enrollTheme: myTheme,
);

4.1.2. iOS Icon Customization #

You can also fully replace the SDK's default logo, step illustrations, popup glyphs, field icons, and UI icons on iOS using the same EnrollTheme API.

Step 1: Add your custom assets to iOS #

  1. Open your iOS project:
ios/Runner.xcworkspace
  1. Navigate to:
Runner → Assets.xcassets
  1. Add your image assets (PNG/SVG supported).

  2. Make sure:

  • The asset is included in the Runner target.
  • The asset name exactly matches the value passed in assetName.
  • The asset is configured correctly for all required scales (1x, 2x, 3x) if using PNG files.

Example:

ios/Runner/Assets.xcassets/my_logo.imageset
ios/Runner/Assets.xcassets/my_location_icon.imageset

After adding the assets, they are immediately ready to use inside the SDK theme configuration.

Step 2: Build an EnrollTheme #

final EnrollTheme myTheme = EnrollTheme(
  colors: EnrollColors(
    primary: const Color(0xFF1D56B8),
    secondary: const Color(0xFF5791DB),
  ),
  icons: const EnrollIcons(
    logo: EnrollLogoConfig(
      mode: EnrollLogoMode.custom,
      assetName: 'my_logo',
      renderingMode: EnrollIconRenderingMode.original,
    ),
    location: EnrollLocationIcons(
      tutorial: EnrollStepIcon(assetName: 'my_location_icon'),
    ),
    common: EnrollCommonIcons(
      termsAndConditions: EnrollStepIcon(assetName: 'my_terms_icon'),
      popups: EnrollPopupIcons(
        successIcon: EnrollStepIcon(assetName: 'my_success_icon'),
      ),
    ),
  ),
);

Step 3: Pass it to the plugin #

EnrollPlugin(
  // ...other parameters...
  enrollTheme: myTheme,
);

Rendering modes #

EnrollIconRenderingMode.original

  • Keeps original asset colors.
  • Recommended for logos and colorful illustrations.

EnrollIconRenderingMode.template

  • Applies SDK tint color to the asset.
  • Recommended for monochrome icons.

Important Notes for iOS #

  • Asset names are case-sensitive.
  • SVG assets are not supported directly in Assets.xcassets.
  • PDF vector assets are recommended.
  • If an asset cannot be resolved, the SDK automatically falls back to the default built-in asset.
  • EnrollTheme takes priority over enrollColors.

Available icon groups #

Group Icons
logo Splash and app-bar logo (EnrollLogoConfig)
location tutorial, requestAccess, accessError, grab
nationalId tutorial, tutorialIdOrPassport, preScan, scanError, choose
passport tutorial, preScan, ePassportPreScan, choose
phone tutorial, select, validateOtp
email tutorial, select, validateOtp
faceMatching tutorial, preScan, error
securityQuestions tutorial, authScreen
password tutorial, authScreen
signature tutorial
common.backgrounds main, layer1, layer2, layer3, blur, header, footer
common.popups background, warningIcon, errorIcon, successIcon
common.fieldIcons user, calendar, gender, issuingAuthority, nationality, num, passport, address, idCard, profession, religion, maritalStatus
common.ui visibility, visibilityOff, mobile, mail, answer, error, info, edit, activePhone
common.termsAndConditions Single icon
update modeIcon, idCard, passport, mobile, email, device, address, securityQuestions, password
forget modeIcon, nationalId, passport, phone, email, device, location, securityQuestions, password

If a drawable or asset cannot be resolved at runtime, the SDK logs a warning and falls back to its built-in asset automatically.


4.2. Text Customization And Localization Overrides #

You can customize SDK text by passing localization JSON files through EnrollTheme.typography.

The example app includes full English and Arabic override files copied from the native Android SDK strings:

example/android/app/src/main/assets/enroll_localizations_en.json
example/android/app/src/main/assets/enroll_localizations_ar.json

Use these files as the editable key list. Keep the keys unchanged and edit only the values you want to override.

The JSON format is:

{
  "localizationOverrides": {
    "en": {
      "skip": "Skip",
      "continue_to_next": "Continue"
    }
  }
}

For Arabic, use the same shape with the ar language key:

{
  "localizationOverrides": {
    "ar": {
      "skip": "تخطي",
      "continue_to_next": "استمرار"
    }
  }
}

Pass the file names without .json:

final EnrollTheme theme = EnrollTheme(
  typography: const EnrollTypography(
    localizationOverrides: EnrollLocalizationOverrides(
      englishFileName: 'enroll_localizations_en',
      arabicFileName: 'enroll_localizations_ar',
    ),
  ),
);

EnrollPlugin(
  // ...other parameters...
  enrollTheme: theme,
);

Android setup #

Place the JSON files under:

android/app/src/main/assets/

Android loads these files from app assets. If the filename has no extension, .json is assumed.

iOS setup #

Place the same JSON files in the iOS app bundle and add them to the Runner target's Copy Bundle Resources phase.

The example already contains iOS reference files:

example/ios/Runner/enroll_localizations_en.json
example/ios/Runner/enroll_localizations_ar.json

These files are intentionally left as iOS-side references. The iOS native implementation owner should update their contents when needed.

Notes #

  • The active language is selected by localizationCode.
  • You can include only the keys you want to change in production apps.
  • The example Android files include all native strings so users can discover the keys.
  • Some protected native keys, such as vendor capture instructions, NFC keys, sample keys, and app_name, are reference-only on Android and are not applied as overrides.

5. ENROLL MODES #

The SDK supports 4 modes defined in the EnrollMode enum:

enum EnrollMode {
  onboarding,
  auth,
  update,
  signContract
}

Mode Details #

Mode Description Requirements
onboarding Registering a new user in the system. tenantId, tenantSecret (required).
auth Verifying the identity of an existing user. tenantId, tenantSecret, applicationId, levelOfTrustToken (all required).
update Updating or re-verifying the identity of an existing user. tenantId, tenantSecret, applicationId (required).
signContract Signing a contract by template or by PDF file. tenantId, tenantSecret, applicationId, and either templateId or signContractFile.

5.1. SIGN CONTRACT #

Use EnrollMode.signContract when the user needs to sign a contract. The plugin supports two configurations:

Configuration When to use it Required fields
Template contract Backend generates the contract from a template. tenantId, tenantSecret, applicationId, templateId. Optional: contractParameters.
PDF file contract Your Flutter app already has the PDF bytes. tenantId, tenantSecret, applicationId, signContractFile. Optional: contractFileName.

Do not pass signContractMode or signContractApproach. The native SDK chooses the correct signing type automatically:

  • If signContractFile is provided, the SDK sends the PDF as multipart file content.
  • If signContractFile is not provided, the SDK uses the template flow with templateId.
  • If contractFileName is omitted for a PDF file contract, the native SDK sends a timestamp filename like yyyyMMdd_HHmmss.pdf.

Template contract example #

EnrollPlugin(
  mainScreenContext: context,
  tenantId: 'TENANT_ID',
  tenantSecret: 'TENANT_SECRET',
  enrollMode: EnrollMode.signContract,
  enrollEnvironment: EnrollEnvironment.staging,
  localizationCode: EnrollLocalizations.en,
  applicationId: 'APPLICATION_ID',
  templateId: 'TEMPLATE_ID',
  contractParameters: '{"amount":"1000"}',
  onSuccess: (applicantId) {
    debugPrint('success: $applicantId');
  },
  onError: (error) {
    debugPrint('Error: $error');
  },
);

PDF file contract example #

final ByteData data = await rootBundle.load('assets/pdf/contract.pdf');
final Uint8List contractBytes = data.buffer.asUint8List();

EnrollPlugin(
  mainScreenContext: context,
  tenantId: 'TENANT_ID',
  tenantSecret: 'TENANT_SECRET',
  enrollMode: EnrollMode.signContract,
  enrollEnvironment: EnrollEnvironment.staging,
  localizationCode: EnrollLocalizations.en,
  applicationId: 'APPLICATION_ID',
  signContractFile: contractBytes,
  contractFileName: 'contract.pdf',
  onSuccess: (applicantId) {
    debugPrint('success: $applicantId');
  },
  onError: (error) {
    debugPrint('Error: $error');
  },
);

6. VALUES DESCRIPTION #

Keys. Values
tenantId Required. Write your organization tenant id.
tenantSecret Required. Write your organization tenant secret.
enrollMode Required. Mode of the SDK. (See Enroll Modes).
environment Required. Select the EnrollEnvironment: EnrollEnvironment.STAGING for staging and EnrollEnvironment.PRODUCTION for production.
enrollCallback Required. Callback function to receive success and error response.
localizationCode Required. Select your language code LocalizationCode.EN for English, and LocalizationCode.AR for Arabic. The default value is English.
googleApiKey Optional. Google Api Key to view the user current location on the map.
applicationId Optional. Write your Application ID. Required for auth, update, and signContract.
levelOfTrustToken Optional. Write your Organization's level of trust (Required for auth).
skipTutorial Optional. Choose to ignore the tutorial or not.
appColors Optional. Customize SDK colors (primary, secondary, background, successColor, warningColor, errorColor, textColor). Works on Android & iOS. Use EnrollColors(primary: Color(...)).
enrollTheme Optional. Unified theme grouping colors, typography, and custom icons. Colors and typography work on Android & iOS;
correlationId Optional. Correlation ID to connect your User ID with our Request ID.
templateId Optional. Template ID for template-based signContract. Required when signContractFile is not provided.
contractParameters Optional. Extra contract parameters for template-based signContract.
signContractFile Optional. PDF bytes for file-based signContract. When provided, the native SDK sends the PDF as multipart file content.
contractFileName Optional. Filename to send with signContractFile. If omitted, the native SDK sends a timestamp name like yyyyMMdd_HHmmss.pdf.
enrollForcedDocumentType Optional. Enroll forced document type to force the users to use a national ID only or a passport only, or allow choosing one of them.
requestId Optional. Write your request ID to allow continuing a previously initiated request (runaway) instead of starting from the beginning.
enrollExitStep Optional. Enroll Step Type to allows the SDK to automatically close after a specified enrollment step passes successfully.

7. ENROLL Step Types #

The SDK supports 13 step type defined in the EnrollStepType enum:

enum EnrollStepType {
  /// One-time password verification sent to the user's phone number.
  /// Used to validate phone ownership.
  phoneOtp,

  /// Confirms the user's personal information (e.g. national ID, passport).
  personalConfirmation,

  /// Performs smile-based liveness detection to ensure the user is physically present step.
  smileLiveness,

  /// One-time password verification sent to the user's email address.
  /// Used to validate email ownership.
  emailOtp,

  /// Registers and saves the current mobile device as a trusted device step.
  saveMobileDevice,

  /// Captures and verifies the user's device location for compliance and security step.
  deviceLocation,

  /// Creates or confirms the user's account password step.
  password,

  /// Verifies answers to predefined security questions for additional authentication step.
  securityQuestions,

  /// Performs Anti-Money Laundering (AML) checks against regulatory databases step.
  amlCheck,

  /// Displays and requires acceptance of the terms and conditions step.
  termsAndConditions,

  /// Captures the user's electronic signature for legal consent step.
  electronicSignature,

  /// Performs NTRA (National Telecom Regulatory Authority) verification step.
  ntraCheck,

  /// Performs CSO (Central Security Office) verification checks step.
  csoCheck,
}

8. SECURITY NOTES #

  • Never hardcode tenantSecret, levelOfTrustToken, or API keys inside the mobile application. Use a secure storage mechanism (e.g., Keychain on iOS, Keystore on Android).
  • Regularly update the SDK to the latest stable version for security patches.
  • Rooted devices are blocked by default for security reasons.

9. Electronic Passport Configuration #

10.1. Android #

  • No additional configuration required. The eNROLL-Android SDK automatically includes :android.permission.NFC ,android.hardware.nfc feature
  • Innovatrics secure environment properties : These are merged automatically into your app's manifest through Gradle's manifest merger.

10.2. iOS #

Step 1: Add NFC Capabilities to Info.plist #

Add the following NFC configuration to your ios/Runner/Info.plist:

<key>com.apple.developer.nfc.readersession.felica.systemcodes</key>
<array>
    <string>A0000002471001</string>
</array>

<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
    <string>A0000002471001</string>
</array>

<key>NFCReaderUsageDescription</key>
<string>We need NFC access to read your electronic passport</string>

Step 2: Enable NFC Capability in Xcode #

  1. Open your iOS project in Xcode (ios/Runner.xcworkspace)
  2. Select your target → Signing & Capabilities
  3. Click + Capability
  4. Add:
Near Field Communication Tag Reading

App Screenshot

NFC reading requires a physical iOS device and will not work on simulators.

4
likes
140
points
472
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

eNROLL is a compliance solution that prevents identity fraud and phishing. Powered by AI, it reduces errors and speeds up identification, ensuring secure verification.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on enroll_plugin

Packages that implement enroll_plugin