FaceCaptureConfig class

Everything the UI team can tune WITHOUT touching camera/detection logic.

Pass a FaceCaptureConfig into FaceCaptureScreen. Any builder you leave null falls back to a sensible default widget, so the screen works out of the box and can be reskinned piece by piece.

Constructors

FaceCaptureConfig({List<FacePoseStep>? steps, double straightYawTolerance = 8.0, double straightPitchTolerance = 8.0, double yawThreshold = 20.0, double pitchThreshold = 15.0, double smileThreshold = 0.7, Duration holdDuration = const Duration(milliseconds: 600), bool autoCapture = true, Color primaryColor = PrimaryColors.p500, Color successColor = const Color(0xFF34C759), Color errorColor = const Color(0xFFFF3B30), Color overlayBackgroundColor = const Color(0xFFFFFFFF), Widget overlayBuilder(BuildContext context, FaceCaptureState state)?, Widget instructionBuilder(BuildContext context, FacePoseStep step)?, Widget progressBuilder(BuildContext context, int completedSteps, int totalSteps)?, Widget captureButtonBuilder(BuildContext context, VoidCallback onCapture)?, Widget successBuilder(BuildContext context)?, Widget errorBuilder(BuildContext context, String message, VoidCallback onRetry)?})
const

Properties

autoCapture → bool
If false, the user must tap a capture button instead of auto-capture.
final
captureButtonBuilder → Widget Function(BuildContext context, VoidCallback onCapture)?
Manual capture button (only rendered if autoCapture is false).
final
errorBuilder → Widget Function(BuildContext context, String message, VoidCallback onRetry)?
Full-screen error widget. Receives the error message and a retry callback.
final
errorColor → Color
final
hashCode → int
The hash code for this object.
no setterinherited
holdDuration → Duration
How long the correct pose must be held before auto-capturing.
final
instructionBuilder → Widget Function(BuildContext context, FacePoseStep step)?
The instruction text/card shown for the current step.
final
overlayBackgroundColor → Color
final
overlayBuilder → Widget Function(BuildContext context, FaceCaptureState state)?
Paints the guide over the camera preview (e.g. an oval, a square frame, a custom SVG mask). Receives the current state so it can react (e.g. turn green when pose is matched).
final
pitchThreshold → double
Minimum head pitch angle (degrees) to count as "up/down". ML Kit's headEulerAngleX: positive = tilted up.
final
primaryColor → Color
Theme colors — used by the default widgets, ignored if you supply your own builders below.
final
progressBuilder → Widget Function(BuildContext context, int completedSteps, int totalSteps)?
Progress indicator (dots, bar, step counter, whatever the UI team wants).
final
resolvedSteps → List<FacePoseStep>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
smileThreshold → double
Minimum smiling probability (0.0–1.0) to count as "smile".
final
steps → List<FacePoseStep>
The sequence of poses to capture, in order.
final
straightPitchTolerance → double
final
straightYawTolerance → double
How far off-center (degrees) the head can be and still count as "straight". Smaller = stricter.
final
successBuilder → Widget Function(BuildContext context)?
Full-screen success widget shown once all steps are captured and upload succeeds.
final
successColor → Color
final
yawThreshold → double
Minimum head yaw angle (degrees) to count as "turned left/right". Positive yaw is the user turning toward their left. iOS front-camera frames are mirrored, so that sign is flipped before this comparison. ML Kit only guarantees Euler Y in accurate detector mode.
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