# Flutter SDK

The FACEKI eKYC SDK is designed to facilitate electronic Know Your Customer (eKYC) processes within applications using Flutter. This SDK simplifies the integration of document and selfie verification processes required for user identity verification.

Pub Dev: <https://pub.dev/packages/faceki_blaze_sdk>

Changelogs: <https://pub.dev/packages/faceki_blaze_sdk/changelog>

### Features&#x20;

* **Document and Selfie Verification:** Streamline the verification processes with easy integrations.
* **Guidance GIFs:** Provides visual guidance to help users capture documents and selfies correctly.
* **Customizable Thresholds and Callbacks:** Offers customization for verification thresholds and processes through callbacks.

### Getting Started&#x20;

#### Installation&#x20;

To add the FACEKI eKYC SDK to your Flutter project, include it in your `pubspec.yaml`: Always refer to GitHub for the latest version number.

```yaml
dependencies:
  faceki_blaze_sdk: <latest>
```

Run `flutter pub get` to install the new dependency.

### iOS&#x20;

#### Add these on ios/Runner/Info.plist:&#x20;

```xml
<key>NSCameraUsageDescription</key>
<string>Your own description</string>
```

#### Add these on ios/Podfile:&#x20;

```ruby
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        'PERMISSION_CAMERA=1',
        'PERMISSION_PHOTOS=1',
      ]
    end
    flutter_additional_ios_build_settings(target)
  end
end
```

### Android&#x20;

#### Change the minimum SDK version to 21 (or higher) in android/app/build.gradle:&#x20;

```gradle
minSdkVersion 21
```

For more: <https://pub.dev/packages/camerawesome>

#### Basic Usage&#x20;

Import the package and initialize the SDK:

```dart
import 'package:faceki_blaze_sdk/faceki_blaze_sdk.dart';

Faceki_Blaze_SDK ekyc = Faceki_Blaze_SDK(
    verification_link: "2607ba32-c906-4e01-sdsd-abec9f56324b",
    record_identifier: "",
    turnGuidanceOff: false,
    language: "en",
    bgColor: 0xFF3D85C6,
    termsAndConditionUrl: "https://www.yourcompany.com/terms",
    onCompleteSelfie: (result) {
      print("Selfie Verification Result: $result");
    },
    screenTexts: {
      "getting_started": {
        "title": "توثيق الحساب",
        "secondary": "سنطلب منك التقاط صورة لوثيقتك وصورة سيلفي.",
        "third": "لأفضل نتيجة للصورة",
        "fourth": "ابحث عن منطقة ذات إضاءة جيدة.",
        "button": "ابدء"
      },
      "document_selection": {
        "title": "اختيار نوع الوثيقة",
        "secondary": "يرجى اختيار نوع الوثيقة",
        "button": "التالي"
      },
      "verification_process": {
        "title": "خطوات عملية التحقق",
        "secondary": "للتحقق، ستحتاج للقيام بما يلي",
        "third": "لقد قرأت الخطوات المذكورة أعلاه وأوافق على ",
        "fourth": "الشروط والأحكام",
        "button": "التالي"
      },
      "card_guidance": {
        "title": "الارشادات",
        "second": "يرجى اتباع إرشادات التقاط الوثائق للحصول على افضل النتائج",
        "button": "التالي"
      },
      "selfie_guidance": {
        "title": "الارشادات للسيلفي",
        "second": "يرجى اتباع إرشادات التقاط السيلفي",
        "button": "التالي"
      },
      "processing_screen": {
        "title": "جارٍ التحقق من هويتك",
        "secondary": "يتم معالجة مستنداتك",
        "third": "سيستغرق الأمر بضع ثوانٍ فقط",
        "button": "التالي"
      }
    }
);

ekyc.launchEKYCFlow(context, (verificationResponse) {
    Navigator.of(context).popUntil((route) => route.isFirst);
});

```

### Configuration Parameters&#x20;

This section details the various parameters that can be configured when initializing the FACEKI eKYC SDK.

#### `verification_link`&#x20;

* **Type:** `String`
* **Description:** Link generated from the API, use the value of the key named "data".

#### `onCompleteSelfie`&#x20;

* **Type:** `DynamicCallback`
* **Description:** A callback function that is triggered after the selfie verification process is completed. This function is used to handle the results of the verification.

#### `termsAndConditionUrl`&#x20;

* **Type:** `String`
* **Description:** A URL linking to the terms and conditions that the user must agree to before using the SDK for verification purposes.

#### `turnGuidanceOff`&#x20;

* **Type:** `Bool` (Optional)
* **Default:** `false`
* **Description:** A boolean to turn off the guidance GIFs if set to true. Useful in cases where custom UI/UX implementations are preferred.

#### `record_identifier`&#x20;

* **Type:** `String` (Optional)
* **Default:** `""`
* **Description:** An optional field used to provide an additional identifier which can be used to record or log the verification process for audit purposes.

#### `bgColor`&#x20;

* **Type:** `int`
* **Description:** Background color for the verification interface, defined as a hex integer.

#### `language`&#x20;

* **Type:** `String`
* **Default:** `"en"`
* **Description:** Language code for displaying text in the verification interface.

#### `screenTexts`&#x20;

* **Type:** `Map<String, Map<String, String>>`
* **Description:** A map containing localized text for different screens in the verification process. Each key corresponds to a specific screen, containing its title, secondary text, and button label.

**Sample: Arabic**

```json
{
  "getting_started": {
    "title": "توثيق الحساب",
    "secondary": "سنطلب منك التقاط صورة لوثيقتك وصورة سيلفي.",
    "third": "لأفضل نتيجة للصورة",
    "fourth": "ابحث عن منطقة ذات إضاءة جيدة.",
    "button": "ابدء"
  },
  "document_selection": {
    "title": "اختيار نوع الوثيقة",
    "secondary": "يرجى اختيار نوع الوثيقة",
    "button": "التالي"
  },
  "verification_process": {
    "title": "خطوات عملية التحقق",
    "secondary": "للتحقق، ستحتاج للقيام بما يلي",
    "third": "لقد قرأت الخطوات المذكورة أعلاه وأوافق على ",
    "fourth": "الشروط والأحكام",
    "button": "التالي"
  },
  "card_guidance": {
    "title": "الارشادات",
    "second": " يرجى اتباع إرشادات التقاط الوثائق للحصول على افضل النتائج",
    "button": "التالي"
  },
  "selfie_guidance": {
    "title": "الارشادات للسيلفي",
    "second": "يرجى اتباع إرشادات التقاط السيلفي",
    "button": "التالي"
  },
  "processing_screen": {
    "title": "جارٍ التحقق من هويتك",
    "secondary": "يتم معالجة مستنداتك",
    "third": "سيستغرق الأمر بضع ثوانٍ فقط",
    "button": "التالي"
  }
}

```

**Sample: English**

```json
{
    "getting_started": {
        "title": "Account Verification",
        "secondary": "We will ask you to take a picture of your document and a selfie.",
        "third": "For the best photo results",
        "fourth": "Find a well-lit area.",
        "button": "Start"
    },
    "document_selection": {
        "title": "Select Document Type",
        "secondary": "Please select the type of document",
        "button": "Next"
    },
    "verification_process": {
        "title": "Verification Process Steps",
        "secondary": "To verify, you will need to do the following",
        "third": "I have read the above steps and agree to",
        "fourth": "the terms and conditions",
        "button": "Next"
    },
    "card_guidance": {
        "title": "Guidelines",
        "second": "Please follow the guidelines for capturing documents to get the best results",
        "button": "Next"
    },
    "selfie_guidance": {
        "title": "Selfie Guidelines",
        "second": "Please follow the guidelines for taking a selfie",
        "button": "Next"
    },
    "processing_screen": {
        "title": "Verifying Your Identity",
        "secondary": "Your documents are being processed",
        "third": "It will only take a few seconds",
        "button": "Next"
    }
}

```

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.faceki.com/mobile-sdk/flutter-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
