samviva 1.0.0
samviva: ^1.0.0 copied to clipboard
A Flutter liveness detection library powered by Google ML Kit. Detect live users with configurable probability thresholds via active face challenges.
1.0.0 #
Initial release of samviva — a Flutter liveness detection library powered by Google ML Kit Face Detection.
Features #
- Plug-and-play
SamvivaLivenessViewwidget — drop into anyScaffoldbody; handles camera initialization, ML Kit processing, and challenge sequencing automatically - 4 active liveness challenges powered by Google ML Kit on-device face classification:
SamvivaLivenessChallenge.blink— detects eye closure viaeyeOpenProbabilitySamvivaLivenessChallenge.smile— detects smile viasmilingProbabilitySamvivaLivenessChallenge.turnLeft— detects head turn viaheadEulerAngleYSamvivaLivenessChallenge.turnRight— detects head turn viaheadEulerAngleY
- Configurable probability thresholds via
SamvivaLivenessConfig:blinkEyeClosedThreshold— lower = stricter blink detectionsmileThreshold— higher = stricter smile detectionheadTurnAngle— higher = must turn head furtherchallengeTimeoutandtotalTimeoutfor session control
- Per-frame probability callback via
onChallengeUpdatefor logging and debugging - Optional success countdown via
successCountdown— shows a 3…2…1 overlay before firingonSuccess - Full color theming via
SamvivaLivenessTheme:activeColor,errorColor,overlayColorstepActiveColor,stepPendingColor,connectorIdleColor
- Full text localisation via
SamvivaLivenessLabels— override every user-visible string (step labels, instructions, state messages) for any language - Full text style customization via
SamvivaLivenessTextStyles:titleStyle,instructionStyle,stepLabelStyle,countdownStyle
- Polished built-in UI:
- Live camera preview with face oval cutout overlay
- Sweeping progress arc around the oval
- Animated step indicator with connector lines
- Glassmorphism instruction card with animated text transitions
- Pulse animation during active detection
- Smooth color transitions between states
- All processing is on-device — no server, no network call
- Supports Android (NV21 image format) and iOS (BGRA8888 image format)