.. _ChapterFlutterIntegration: ******************* 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 ^^^^^^^^^^^ .. image:: screen_home.png :align: center :alt: Home Screen :width: 350px :height: 600px :scale: 50 % Settings Screen ^^^^^^^^^^^^^^^ .. image:: screen_settings.png :align: center :alt: Settings Screen :width: 350px :height: 600px :scale: 50% Capture Screen ^^^^^^^^^^^^^^ .. image:: screen_capture.png :align: center :alt: Settings Screen :width: 350px :height: 600px :scale: 50% Result Screen ^^^^^^^^^^^^^ .. image:: screen_result.png :align: center :alt: Settings Screen :width: 350px :height: 600px :scale: 50% 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Create a Face Capture Object* :name: createAFaceCaptureObject FaceCapture faceCaptureLibrary = FaceCapture(); Create a Workflow Object ^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Create a Workflow Object* :name: createAWorkflowObject WorkFlow faceCaptureWorkflow; faceCaptureLibrary.workflowCreate(settingWorkflow); Adjust Workflow Settings ^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Adjust Workflow Settings* :name: adjustWorkflowSettings faceCaptureLibrary.setProperty(WorkflowProperty.username, settingUsername); faceCaptureLibrary.setProperty(WorkflowProperty.timeout, settingCaptureTimeout); faceCaptureLibrary.setProperty(WorkflowProperty.profile, settingCaptureProfile); Select a Camera ^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Select a camera* :name: selectACamera List cameras[]; cameras = faceCaptureLibrary.getCameraList(CameraPosition.front); cameras[0].setOrientation(CameraOrientation.portrait); Begin a Capture Session ^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Begin a Capture Session* :name: beginACaptureSession faceCaptureLibrary.startCaptureSession(faceCaptureWorkflow, cameras[0]); Stop a Capture Session ^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Stop a Capture Session* :name: stopACaptureSession faceCaptureLibrary.stopCaptureSession(); Get the capture region ^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Get capture region* :name: getTheCaptureRegion faceCaptureLibrary.captureSessionGetCaptureRegion(); Handle Capture Session State ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Capture Session State* :name: captureSessionState faceCaptureLibrary.getCaptureSesssionState(); Handle Capture Session Images ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Capture Session Images* :name: captureSessionImages faceCaptureState.getFrame(); Handle Capture Session Feedback ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Capture Session Feedback* :name: captureSessionFeedback faceCaptureState.getFeedback(); Handle Capture Session Status Changes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Capture Session Status Changes* :name: captureSessionStatusChanges faceCaptureState.getStatus(); Get the Server Package ^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Get the Server Package* :name: getTheServerPackage faceCaptureLibrary.getServerPackage(); Get the Encrypted Server Package ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Get the Encrypted Server Package* :name: getTheEncryptedServerPackage faceCaptureLibrary.getEncryptedServerPackage(); Enable Autocapture ^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Enable Autocapture* :name: enableAutocapture faceCaptureLibrary.captureSessionEnableAutocapture(true);