LivenessConfig class

Configuration class for customizing the Face Liveness Detection package

Constructors

LivenessConfig.new({Duration maxSessionDuration = LivenessConstants.defaultMaxSessionDuration, double minFaceSize = LivenessConstants.defaultMinFaceSize, double eyeBlinkThresholdOpen = LivenessConstants.defaultEyeBlinkThresholdOpen, double eyeBlinkThresholdClosed = LivenessConstants.defaultEyeBlinkThresholdClosed, double smileThresholdNeutral = LivenessConstants.defaultSmileThresholdNeutral, double smileThresholdSmiling = LivenessConstants.defaultSmileThresholdSmiling, double headTurnThreshold = LivenessConstants.defaultHeadTurnThreshold, double minLightingThreshold = LivenessConstants.defaultMinLightingThreshold, int brightPixelThreshold = LivenessConstants.defaultBrightPixelThreshold, double minBrightPercentage = LivenessConstants.defaultMinBrightPercentage, double maxBrightPercentage = LivenessConstants.defaultMaxBrightPercentage, double cameraZoomLevel = LivenessConstants.defaultCameraZoomLevel, int maxMotionReadings = LivenessConstants.defaultMaxMotionReadings, int maxHeadAngleReadings = LivenessConstants.defaultMaxHeadAngleReadings, double significantHeadAngleRange = LivenessConstants.defaultSignificantHeadAngleRange, double minDeviceMovementThreshold = LivenessConstants.defaultMinDeviceMovementThreshold, double ovalHeightRatio = LivenessConstants.defaultOvalHeightRatio, double ovalWidthRatio = LivenessConstants.defaultOvalWidthRatio, double strokeWidth = LivenessConstants.defaultStrokeWidth, double guideMarkerRatio = LivenessConstants.defaultGuideMarkerRatio, double guideMarkerInnerRatio = LivenessConstants.defaultGuideMarkerInnerRatio, List<ChallengeType>? challengeTypes, int numberOfRandomChallenges = 3, bool alwaysIncludeBlink = true, Map<ChallengeType, String>? challengeInstructions})
const

Properties

Always include blink challenge (as it's harder to spoof)
final
brightPixelThreshold int
Pixel value (0-255) for detecting overly bright regions
final
cameraZoomLevel double
Camera zoom level for better face visibility
final
challengeInstructions Map<ChallengeType, String>?
Custom messages for each challenge type
final
challengeTypes List<ChallengeType>?
List of challenge types to use If null, random challenges will be generated
final
eyeBlinkThresholdClosed double
Threshold value for eyes to be considered closed (0.0-1.0)
final
eyeBlinkThresholdOpen double
Threshold value for eyes to be considered open (0.0-1.0)
final
guideMarkerInnerRatio double
Ratio for the inner guide markers
final
guideMarkerRatio double
Ratio for the outer guide markers
final
hashCode int
The hash code for this object.
no setterinherited
headTurnThreshold double
Angle in degrees for head to be considered turned
final
maxBrightPercentage double
Maximum percentage of bright pixels to detect screen glare
final
maxHeadAngleReadings int
Maximum number of head angle readings to store
final
maxMotionReadings int
Maximum number of motion sensor readings to store
final
maxSessionDuration Duration
Duration after which the session expires and resets
final
minBrightPercentage double
Minimum percentage of bright pixels to detect screen glare
final
minDeviceMovementThreshold double
Minimum device movement threshold for spoofing detection
final
minFaceSize double
Minimum relative size a face must be to be detected
final
minLightingThreshold double
Minimum threshold for adequate lighting (0.0-1.0)
final
numberOfRandomChallenges int
Number of challenges to present to the user Only used if challengeTypes is null
final
ovalHeightRatio double
Height ratio of the oval face guide relative to screen height
final
ovalWidthRatio double
Width ratio of the oval face guide relative to its height
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
significantHeadAngleRange double
Range of head angles considered significant for spoofing detection
final
smileThresholdNeutral double
Threshold value for face to be considered neutral/not smiling (0.0-1.0)
final
smileThresholdSmiling double
Threshold value for face to be considered smiling (0.0-1.0)
final
strokeWidth double
Stroke width of the oval face guide
final

Methods

copyWith({Duration? maxSessionDuration, double? minFaceSize, double? eyeBlinkThresholdOpen, double? eyeBlinkThresholdClosed, double? smileThresholdNeutral, double? smileThresholdSmiling, double? headTurnThreshold, double? minLightingThreshold, int? brightPixelThreshold, double? minBrightPercentage, double? maxBrightPercentage, double? cameraZoomLevel, int? maxMotionReadings, int? maxHeadAngleReadings, double? significantHeadAngleRange, double? minDeviceMovementThreshold, double? ovalHeightRatio, double? ovalWidthRatio, double? strokeWidth, double? guideMarkerRatio, double? guideMarkerInnerRatio, List<ChallengeType>? challengeTypes, int? numberOfRandomChallenges, bool? alwaysIncludeBlink, Map<ChallengeType, String>? challengeInstructions}) LivenessConfig
Create a copy of this configuration with some values replaced
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