Flutter Integration

Overview

The Face Capture SDK comes with a Flutter interface for integration. This chapter will outline the requirements for Flutter integration, how to operate the included developer demo, and which parts of the demo source code correspond to the integration tasks outlined in the Application Design chapter.

Integration Requirements

The Face Capture SDK requires Camera permissions.

Demo Operation

The Face Capture SDK comes with a small developer demo that is intended to show how various options work. The demo allows developers to rapidly test various combinations of settings to determine what they need to adjust to meet their own application’s requirements. The demo is not intended to resemble a finished product and provides the user with many options that should not be accessible to an end-user in a production environment. Source code for the demo is provided within the SDK installer package.

Home Screen

Home Screen

Settings Screen

Settings Screen

Capture Screen

Settings Screen

Result Screen

Settings Screen

Demo Code

This section provides details regarding the Face Capture API and how it is used to implement an application.

Create a Face Capture Object

Create a Face Capture Object
   FaceCapture faceCaptureLibrary = FaceCapture();

Create a Workflow Object

Create a Workflow Object
   WorkFlow faceCaptureWorkflow;
   faceCaptureLibrary.workflowCreate(settingWorkflow);

Adjust Workflow Settings

Adjust Workflow Settings
   faceCaptureLibrary.setProperty(WorkflowProperty.username, settingUsername);
   faceCaptureLibrary.setProperty(WorkflowProperty.timeout, settingCaptureTimeout);
   faceCaptureLibrary.setProperty(WorkflowProperty.profile, settingCaptureProfile);

Select a Camera

Select a camera
   List cameras[];
   cameras = faceCaptureLibrary.getCameraList(CameraPosition.front);
   cameras[0].setOrientation(CameraOrientation.portrait);

Begin a Capture Session

Begin a Capture Session
   faceCaptureLibrary.startCaptureSession(faceCaptureWorkflow, cameras[0]);

Stop a Capture Session

Stop a Capture Session
   faceCaptureLibrary.stopCaptureSession();

Get the capture region

Get capture region
   faceCaptureLibrary.captureSessionGetCaptureRegion();

Handle Capture Session State

Capture Session State
   faceCaptureLibrary.getCaptureSesssionState();

Handle Capture Session Images

Capture Session Images
   faceCaptureState.getFrame();

Handle Capture Session Feedback

Capture Session Feedback
   faceCaptureState.getFeedback();

Handle Capture Session Status Changes

Capture Session Status Changes
   faceCaptureState.getStatus();

Get the Server Package

Get the Server Package
   faceCaptureLibrary.getServerPackage();

Get the Encrypted Server Package

Get the Encrypted Server Package
   faceCaptureLibrary.getEncryptedServerPackage();

Enable Autocapture

Enable Autocapture
   faceCaptureLibrary.captureSessionEnableAutocapture(true);