enroll_plugin 1.4.0
enroll_plugin: ^1.4.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
- You can find the latest version here https://pub.dev/packages/enroll_plugin/versions
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

- For iOS

ℹ️ 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 #
- Open your iOS project:
ios/Runner.xcworkspace
- Navigate to:
Runner → Assets.xcassets
-
Add your image assets (PNG/SVG supported).
-
Make sure:
- The asset is included in the
Runnertarget. - 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.
EnrollThemetakes priority overenrollColors.
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.
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, applicantId, levelOfTrustToken (all required). |
update |
Updating or re-verifying the identity of an existing user. | tenantId, tenantSecret, applicantId (required). |
signContract |
Signing contract templates by a user. | tenantId, tenantSecret, templateId (required). Optional: contractParameters. |
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. |
applicantId |
Optional. Write your Application ID (Required for auth and recommended for update). |
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 (Under Development). Unified theme grouping colors + custom icons. Android only at this time. If provided alongside appColors, enrollTheme takes priority. |
correlationId |
Optional. Correlation ID to connect your User ID with our Request ID. |
templateId |
Optional. The ID of the contract to be signed (Required for signContract). |
contractParameters |
Optional. Extra contract parameters for signContract. |
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 #
- Open your iOS project in Xcode (
ios/Runner.xcworkspace) - Select your target → Signing & Capabilities
- Click + Capability
- Add:
Near Field Communication Tag Reading

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