start method
Future<void>
start({
- required LivenessDetectionOnFocusCallback onFocus,
- required LivenessDetectionOnFrameCallback onFrame,
- required LivenessDetectionOnInitializedCallback onInitialized,
- required LivenessDetectionOnFocusDroppedCallback onFocusDropped,
- required LivenessDetectionOnPromptCompletedCallback onPromptCompleted,
- required LivenessDetectionOnCountDownChangedCallback onCountDownChanged,
- required LivenessDetectionOnAllPromptsCompletedCallback onAllPromptsCompleted,
- required LivenessDetectionOptions options,
Initializes the camera and starts the scanning process.
When the camera is initialized onInitialized
is called.
After the initialization process, the scanning process begins and on every frame onFrame
is called.
When the camera detects a face in the center of frame, onFocus
is called.
After the user completed each prompt, onPromptCompleted
is called.
Implementation
Future<void> start({
required LivenessDetectionOnFocusCallback onFocus,
required LivenessDetectionOnFrameCallback onFrame,
required LivenessDetectionOnInitializedCallback onInitialized,
required LivenessDetectionOnFocusDroppedCallback onFocusDropped,
required LivenessDetectionOnPromptCompletedCallback onPromptCompleted,
required LivenessDetectionOnCountDownChangedCallback onCountDownChanged,
required LivenessDetectionOnAllPromptsCompletedCallback
onAllPromptsCompleted,
required LivenessDetectionOptions options,
}) async {
await _methodChannel.invokeMethod('start', options.toMap());
_registerEventListener(
onFocus: onFocus,
onFrame: onFrame,
onInitialized: onInitialized,
onFocusDropped: onFocusDropped,
onPromptCompleted: onPromptCompleted,
onCountDownChanged: onCountDownChanged,
onAllPromptsCompleted: onAllPromptsCompleted,
);
}