SplicerAi Flutter Plugin

Pub Version

Extrieve Technologies - Your Expert in Document Management & AI Solutions

The SplicerAi Flutter Plugin provides a set of functionalities for integrating advanced document management and AI-powered KYC (Know Your Customer) solutions into your Flutter applications. With this plugin, you can easily perform Aadhaar masking, detect and extract information from KYC documents, and verify KYC documents against specific document types with enterprise ready compliance.

Features

  • Aadhaar Masking: Automatically mask sensitive information on Aadhaar cards to protect user privacy.

  • KYC Document Detection: Detect the type of KYC document provided (e.g., Aadhaar, Passport, PAN Card).

  • KYC Information Extraction: Extract structured data from KYC documents for easy processing.

  • KYC Document Verification: Verify the authenticity of KYC documents against supported document types.

  • Supported Document Types: Retrieve a list of all KYC document types supported by the plugin.

  • Supported Document Sub Types: Retrieve a list of all KYC document Sub types supported by the plugin.

  • Supported Document Field List: Retrieve a list fields that all KYC document types supported by the plugin.

Getting Started

This plugin provides a simple interface to leverage SplicerAi's document management and AI capabilities in your Flutter applications.

Prerequisites

  • Flutter SDK: Make sure you have Flutter installed on your machine. For installation instructions, visit Flutter's official website.
  • Dart SDK: Included with the Flutter SDK.

Run time requirement

  • x This plugin is designed to run on officially supported Android & iOS devices only.
  • x On Android, Google Play Services is mandatory.
  • x Supported CPU architectures: arm64-v8a and armeabi-v7a.
  • x Simulator and emulator environments are not supported.For testing on simulators, please contact the development support team to request a dedicated test version compatible with those environments.

Compatibility

  • Java: Requires Java 17 or later.
  • Android:
    • Minimum SDK: API 21
    • Target SDK: API 36
    • Compiled SDK: API 34
  • iOS:
    • Requires iOS 13 or later.
    • Only real devices are supported; simulator support is not provided due to the size limitations of the Flutter plugin.
    • Additionally, Apple's simulator does not support camera functionalities, making it unsuitable for testing document capture features.

Installation

Add splicerai to your project's pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  splicerai: ^1.0.0 # Replace with the latest version

Then, run flutter pub get to fetch the package.

Integration

Import the Package

import 'package:splicerai/splicerai.dart';

License Activation

Before using the plugin, you need to activate your license. Replace "<Your Android License Key>"with the license keys provided by Extrieve Technologies.

  String androidLicense = "<Your Android License Key>";
  String iosLicense = "<Your IOS License Key>";

  bool? isActivated = await SplicerAi().activateLicense(
    android: androidLicense,
    ios: iosLicense,
  );

  if (isActivated == true) {
    print("License activated successfully");
  } else {
    print("License activation failed. Please check your license.");
  }

Usage Examples

1. Aadhaar Masking

Mask sensitive aadhaar number on an Aadhaar card image.

  String? maskedImagePath = await SplicerAi.maskAadhaar(imagePath);

  if (maskedImagePath != null) {
    print("Aadhaar masked successfully. Masked image path: $maskedImagePath");
  } else {
    print("Failed to mask Aadhaar");
  }
2. KYC Document Detection

Detect the type of KYC document in an image.

  String? detectionResult = await SplicerAi.detectKYCDocument(imagePath);

  if (detectionResult != null) {
    print("KYC Document detected: $detectionResult");
  } else {
    print("Failed to detect KYC document");
  }

Following is a sample response structure :

  {
    "STATUS": true,
    "DESCRIPTION":"<Description + subtype of document>",
    "TYPE" : "Name/type of document>",
    "SUBTYPE":"<subtype of document>", // AADHAAR_BACK
    "CONFIDENCE" : "<Level of accuracy: High/Medium/Low>",
    "OCR_QUALITY":  "DEFAULT",
    "PREDICTED_DOCS": {
    //If any other documents are detected,
    //Same will be listed out with the confidence level
        "AADHAAR": "HIGH"
    },
  }

3. KYC Information/Entity Extraction

Extract information/entities from supported KYC document.

  String? extractionResult = await SplicerAi.extractKYCDocument(imagePath);

  if (extractionResult != null) {
    print("KYC Document extraction result: $extractionResult");
  } else {
    print("Failed to extract KYC document");
  }

Following is a sample response structure :

  {
    "STATUS": true,
    "DESCRIPTION": "AADHAAR_FRONT",// Description of operation - includes "subtype"
    "TYPE": "AADHAAR",// Identidied document type
    "SUBTYPE": "AADHAAR_FRONT",// Dedicated Subtype (specify document front/back)
    "CONFIDENCE": "HIGH",
    "OCR_QUALITY": "DEFAULT",
    "PREDICTED_DOCS": {
      "AADHAAR": "HIGH"
    },
    "KEY_VALUES": {
    /* Section contain all extracted entities & it's values.
    Can be enabled/disabled by: Config.DocumentExtraction.GetKeyValueForKYCExtract = true/false;
    This section is enabled by default*/
      "NAME": "NAME",
      "GENDER": "MALE",
      "DOB": "16/09/1981",
      "AADHAARNO": "2513 5077 5668",
    },
    "DATA": {
      /* This section contains same entities & its values as like KEY_VALUES section, 
      But with extra info. like confidence.
      Can be enable/disable by: Config.DocumentExtraction.GetDataForKYCExtract = true/false; 
      This section is disabled by default 
      */
      "NAME": {
        "VALUE": "NAME",
        "CONFIDENCE": "HIGH/MEDIUM/LOW"
      },
      "GENDER": {
        "VALUE": "MALE",
        "CONFIDENCE": "HIGH/MEDIUM/LOW"
      },
      "DOB": {
        "VALUE": "16/09/1981",
        "CONFIDENCE": "HIGH/MEDIUM/LOW"
      },
      "AADHAAR NO": {
        "VALUE": "1713 1077 1668",
        "CONFIDENCE": "HIGH/MEDIUM/LOW"// For empty value, confidence also will be empty
      }
    }
  }
4. KYC Document Verification

Verify a KYC document against a specified document type.

  String? verificationResult = await SplicerAi.verifyKYCDocument(
    imagePath,
    documentType,
  );

  if (verificationResult != null) {
    print("KYC Document verification result: $verificationResult");
  } else {
    print("Failed to verify KYC document");
  }

Following is a sample response structure :

  {
    "STATUS": true/false,
    "DESCRIPTION": "<Verified Successfully/failed>",
    "CONFIDENCE" : "LOW/MEDIUM/HIGH",
    "OCRQUALITY": "<ocrquality>"
  }
5. Get Supported KYC Document Types

Retrieve a list of all supported KYC document types.

  String? docListJson = await SplicerAi.getSupportedKYCDocList();
  if (docListJson != null) {
    List<dynamic> docList = jsonDecode(docListJson);
    print("Supported KYC Documents: ${docList.join(', ')}");
  } else {
    print("Failed to retrieve supported KYC documents");
  }

Following is a sample response structure :

  ["AADHAAR","PAN_CARD","PASSPORT"]
6. Get Supported KYC Document Sub-types

Retrieve a list of all supported KYC Document Sub-Types (front/back/both) docuemnt side

  String? jsonString = await SplicerAi.getSupportedKYCDocSubTypes();
  if (jsonString != null && jsonString.isNotEmpty) {
    // Parse the JSON string to a List<String>
    _showSnackBar('Supported KYC document subtypes : $jsonString');
  } else {
    _showSnackBar('No supported KYC document subtypes found.');
  }

Following is a sample response structure :

  {
    "DRIVING_LICENSE" : [ "DL_BACK", "DL" ],
    "PAN_CARD" : [ "PAN_CORPORATE", "PAN" ],
    "VOTER_ID" : [ "VOTER_ID_BACK", "VOTERID" ],
    "PASSPORT" : [ "PASSPORT_BACK", "PASSPORT" ],
    "AADHAAR" : [ "AADHAAR_FRONT", "AADHAAR_BACK" ]
  }
7. Get Supported KYC Document Fields List

Retrieve a list of all supported KYC Document Fields List

  String? jsonString = await SplicerAi.getSupportedKycDocFieldList();
  if (jsonString != null && jsonString.isNotEmpty) {
    // Parse the JSON string to a List<String>
    _showSnackBar('Supported KYC document fields : $jsonString');
  } else {
    _showSnackBar('No supported KYC document fields found.');
  }

Following is a sample response structure :

  {
    "DRIVING_LICENSE": ["NAME","DOB", ...],
    "PAN_CARD": ["NAME","FATHER'S NAME", ...],
    "VOTER_ID": ["NAME", "DOB", ...],
    "AADHAAR": ["NAME", "DOB", "GENDER", ...],
    "PASSPORT": ["SURNAME", "GIVEN NAME", "DOB", ...]
  }

Configurations

Enable/Disable Data section in KYC Extraction

When enabled, Data section in KYCExtraction response will be available. Contains entities & additional extraction informations like confidence. Disabled by default.

  final _splicerAiPlugin = SplicerAi();
  _splicerAiPlugin.config.kycExtraction.getDataForKYCExtract = false;

Enable/Disable KEY_VALUES section in KYC Extraction

When enabled, KEY_VALUES section will be available in KYC Extraction response. Contains only each entities & it's values. Enabled by default.

  final _splicerAiPlugin = SplicerAi();
  _splicerAiPlugin.config.kycExtraction.getDataForKYCExtract = false;

Complete Example

Here is a complete example integrating all the above functionalities:

import 'package:flutter/material.dart';
import 'package:splicerai/splicerai.dart';
import 'dart:convert';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // Application root
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SplicerAi Demo',
      home: SplicerAiDemo(),
    );
  }
}

class SplicerAiDemo extends StatefulWidget {
  @override
  _SplicerAiDemoState createState() => _SplicerAiDemoState();
}

class _SplicerAiDemoState extends State<SplicerAiDemo> {
  @override
  void initState() {
    super.initState();
    activateLicense();
  }

  Future<void> activateLicense() async {
    String androidLicense = "<Your Android License Key>";
    String iosLicense = "<Your iOS License Key>";

    try {
      bool? isActivated = await SplicerAi().activateLicense(
        android: androidLicense,
        ios: iosLicense,
      );

      if (isActivated == true) {
        print("License activated successfully");
      } else {
        print("License activation failed. Please check your license.");
      }
    } catch (e) {
      print("Error activating license: ${e.toString()}");
    }
  }

  // Implement other methods as needed...

  @override
  Widget build(BuildContext context) {
    // Build your UI here
    return Scaffold(
      appBar: AppBar(
        title: Text('SplicerAi Demo'),
      ),
      body: Center(
        child: Text('Integrate SplicerAi features here'),
      ),
    );
  }
}

Document supported

KYC Documents

List of KYC documents, their respective subtypes, and the key-value pairs "expected" from the current trained set of the SplicerAi :

  1. PAN_CARD : NAME, FATHER'S NAME, DOB, PAN NO
  2. AADHAAR : NAME, DOB, GENDER, AADHAAR NO, ADDRESS, YEAR OF BIRTH
  3. DRIVING_LICENSE : NAME, DOB, S/D/W, ADDRESS, DATE OF ISSUE, DATE OF EXPIRY, LICENSE NO.
  4. VOTER_ID : NAME, DOB, GUARDIAN'S NAME, ADDRESS, UID, GENDER
  5. PASSPORT : SURNAME, GIVEN NAME, DOB, DATE OF ISSUE, DATE OF EXPIRY, PASSPORT NO, PLACE OF BIRTH, PLACE OF ISSUE, GENDER, NATIONALITY, COUNTRY CODE

Following are the extra subtype supported : (subtypes will provided as part of description)

  1. PAN_CARD – PAN_CORPORATE
  2. PASSPORT – PASSPORT_BACK
  3. VOTER_ID – VOTER_ID_BACK
  4. DRIVING_LICENSE – DL_BACK
  5. AADHAAR - AADHAAR_BACK & AADHAAR_FRONT

Regarding accuracy :

The accuracy of Detection & Extaction technologies depends significantly on the quality of input images, including factors such as image wrapping, stretching, angle of rotation, lighting conditions, and colour consistency. While offline solutions are effective for reducing manual efforts in scenarios having additional verification measures, cannot guarantee 100% accuracy.Even though we are aiming and provinding 88-93% accuracy.


Note: Replace placeholders like "<Your Android License Key>" and "<Your iOS License Key>" with your actual license keys provided by Extrieve Technologies.

By integrating the SplicerAi Flutter Plugin, you can enhance your application with powerful document management and AI capabilities, providing users with secure and efficient KYC processing.


Additional Information

Getting Help

For help getting started with Flutter, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Important

  • Privacy and Security: Always handle user data securely and ensure compliance with applicable laws and regulations when processing personal identification documents.
  • Error Handling: Implement proper error handling in your application to provide a smooth user experience.

© 1996 - 2025 Extrieve Technologies