LivenessCheckSettings class

Behavior settings for the liveness check.

Constructors

LivenessCheckSettings({bool enableBlinkDetection = true, int requiredBlinkCount = 3, bool enableSmileDetection = true, bool enableEyesClosedCheck = true, bool showProgress = true, bool autoNavigateOnSuccess = true, bool showErrorMessage = true, bool showTryAgainButton = true, int maxRetryAttempts = 3, Duration processingTimeout = const Duration(seconds: 30), double circlePositionY = 0.38, Duration? photoCaptureDelay = const Duration(milliseconds: 0), int antiSpoofingClearnessThreshold = 800, double? eulerAngleThresholdIOS = 5.0, double? eulerAngleThresholdAndroid = 6.0, double? faceToHeadRatioMinIOS, double? faceToHeadRatioMaxIOS, double? faceToHeadRatioMinAndroid, double? faceToHeadRatioMaxAndroid, double? eyeToMouthRatioMin, double? mouthPositionRatioMin, double? mouthPositionRatioMax, double? eyePositionRatioMin, double? eyePositionRatioMax, double errorMessageMargin = 80.0, double errorMessageTopPadding = 0.0})
Creates liveness check settings.
const

Properties

antiSpoofingClearnessThreshold → int
Clearness threshold for anti-spoofing image quality check. Higher values require clearer images. Default is 800.
final
autoNavigateOnSuccess → bool
Whether to automatically navigate on successful verification.
final
circlePositionY → double
Vertical position of the circle (0.0 to 1.0).
final
enableBlinkDetection → bool
Whether to enable blink detection for liveness check.
final
enableEyesClosedCheck → bool
Whether to check if eyes are closed and show error message. When enabled, shows a specific error when eyes are detected as closed. Note: This check is automatically skipped when enableBlinkDetection is true, as blink detection requires eyes to close. Most useful in smile-only mode. Default is true.
final
enableSmileDetection → bool
Whether to enable smile detection for liveness check.
final
errorMessageMargin → double
Margin/spacing between error message and the camera circle (in pixels). Controls how far above the circle the error message appears. Default: 80 pixels.
final
errorMessageTopPadding → double
Top padding/spacing above the error message text (in pixels). Adds extra space between the container border and the text. Default: 0 pixels.
final
eulerAngleThresholdAndroid → double?
final
eulerAngleThresholdIOS → double?
Euler angle threshold for face centering validation (in degrees). Determines how much head rotation is allowed. iOS default: 5.0 degrees, Android default: 10.0 degrees. Lower values are more strict, higher values are more lenient.
final
eyePositionRatioMax → double?
final
eyePositionRatioMin → double?
Eye position ratio thresholds for Android (position in face bounding box). Default: min 0.2, max 0.52
final
eyeToMouthRatioMin → double?
Eye-to-mouth ratio threshold for Android face validation. Minimum ratio of eye-to-mouth distance to face height. Default: 0.27. Lower values are more strict.
final
faceToHeadRatioMaxAndroid → double?
final
faceToHeadRatioMaxIOS → double?
final
faceToHeadRatioMinAndroid → double?
final
faceToHeadRatioMinIOS → double?
Face-to-head ratio thresholds (face height / image height). Controls how much of the image the face should occupy. iOS defaults: min 0.3, max 0.9 (more relaxed) Android defaults: min 0.5, max 0.8 (stricter)
final
hashCode → int
The hash code for this object.
no setterinherited
maxRetryAttempts → int
Maximum number of retry attempts allowed.
final
mouthPositionRatioMax → double?
final
mouthPositionRatioMin → double?
Mouth position ratio thresholds for Android (position in face bounding box). Default: min 0.57, max 0.92
final
photoCaptureDelay → Duration?
Delay before capturing photo after liveness check passes.
final
processingTimeout → Duration
Timeout duration for processing.
final
requiredBlinkCount → int
Number of blinks required to pass the liveness check.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showErrorMessage → bool
Whether to show error messages to the user.
final
showProgress → bool
Whether to show progress indicators during the check.
final
showTryAgainButton → bool
Whether to show the try again button on failure.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited