Giter Site home page Giter Site logo

flutter_onfido_plus's Introduction

flutter_onfido_plus

Onfido SDK flutter plugin. Inspired and based on Onfido react-native-sdk

Android SDK: 12.2.2

iOS SDK: 25.1.1

Project adjustments

Android

Enable multidex in android/app/build.gradle:

android {
  defaultConfig {
    ...
    multiDexEnabled true
  }
}

iOS

Update your iOS configuration files

Change ios/Podfile to use version 10:

platform :ios, '11.0'

Add descriptions for camera and microphone permissions to ios/YourProjectName/Info.plist:

<plist version="1.0">
<dict>
  <!-- Add these four elements: -->
    <key>NSCameraUsageDescription</key>
    <string>Required for document and facial capture</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Required for video capture</string>
  <!-- ... -->
</dict>
</plist>

Usage

 var result = await FlutterOnfido.start(
    config: OnfidoConfig(
        sdkToken: "SDK_TOKEN_JWT",
        flowSteps: OnfidoFlowSteps(
            welcome: false,
            captureDocument: OnfidoCaptureDocumentStep(countryCode: OnfidoCountryCode.USA, docType: OnfidoDocumentType.GENERIC),
            captureFace: OnfidoCaptureFaceStep(OnfidoCaptureType.PHOTO),
        ),
    ),
    iosAppearance: OnfidoIOSAppearance(),
);

Parameters details:

  • sdkToken: Required. This is the JWT sdk token obtained by making a call to the SDK token API.
  • flowSteps: Required. This object is used to toggle individual screens on and off and set configurations inside the screens.

Flow steps:

  • welcome: Optional. This toggles the welcome screen on or off. If omitted, this screen does not appear in the flow.
  • captureDocument: Optional. This object contains configuration for the capture document screen. If docType and countryCode are not specified, a screen will appear allowing the user to choose these values. If omitted, this screen does not appear in the flow.
  • docType: Required if countryCode is specified. Note: GENERIC document type doesn't offer an optimised capture experience for a desired document type.
  • countryCode: Required if docType is specified.
  • captureFace: Optional. This object object containing options for capture face screen. If omitted, this screen does not appear in the flow.
  • type: Required if captureFace is specified.

Theme

For iOS theme config use OnfidoAppearance class and its properties.

For Android in order to enhance the user experience on the transition between your application and the SDK, you can provide some customization by defining certain colors inside your own colors.xml file inside android folder and project:

  • onfidoColorPrimary: Defines the background color of the Toolbar which guides the user through the flow

  • onfidoColorPrimaryDark: Defines the color of the status bar above the Toolbar

  • onfidoTextColorPrimary: Defines the color of the title on the Toolbar

  • onfidoTextColorSecondary: Defines the color of the subtitle on the Toolbar

  • onfidoColorAccent: Defines the color of the FloatingActionButton which allows the user to move between steps, as well as some details on the alert dialogs shown during the flow

  • onfidoPrimaryButtonColor: Defines the background color of the primary action buttons (e.g. proceed to the next flow step, confirm picture/video, etc), the color of the text on the secondary action buttons (e.g. retake picture/video) and the background color of some icons and markers during the flow

  • onfidoPrimaryButtonColorPressed: Defines the background color of the primary action buttons when pressed

  • onfidoPrimaryButtonTextColor: Defines the color of the text inside the primary action buttons

Contributions

Inspired and based on Onfido react-native-sdk. Java has been changed to kotlin which I don't know well so code may be improved. I won't maintain this package very frequently, feel free to contribute! Some action points:

TODO:

  • - localization support
  • - add support for hide logo and cobranding enterprise features
  • - better example project
  • - tests
  • - improve docs
  • - improve kotlin code

Getting Started with Flutter plugins

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

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

Acknowledgments

This project is a fork from flutter_onfido and we did have acknowledgments for a great job of @geweald and the community that helps him.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.