flutter_liveness_actions 1.3.4
flutter_liveness_actions: ^1.3.4 copied to clipboard
Liveness-aware face action helpers for Flutter mobile apps using Google ML Kit Face Detection. Not an identity verification SDK.
Example app #
Android/iOS demo host for flutter_liveness_actions.
Not identity verification, KYC, AML, or fraud prevention — derived face-action signals only. Screenshots use a schematic face placeholder (no real biometric imagery).
Screenshots #
Demo flows #
| Demo | What it shows |
|---|---|
| Real-time detection | Live HUD (eye/yaw/pitch) + performance profile switching |
| Live camera demo | Preview, oval guide, signal chips |
| Live challenge | Guided blink / turn / hold-still via LivenessActionSession |
| Follow the dot | Face-center target path with smooth motion + confetti finale |
| Randomized challenge | Seeded shuffled sequence + nonce |
| Simulated flow | Camera-free state machine (tap to advance steps) |
Run #
cd example
flutter pub get
flutter run
Requires a real Android or iOS device (or simulator with camera). Grant camera permission when prompted. iOS deployment target is 15.5+ (ML Kit).
Minimal session wiring #
The example feeds ML Kit faces into the package session like this:
import 'package:flutter_liveness_actions/flutter_liveness_actions.dart';
final session = LivenessActionSession(
sessionId: 'demo',
enableChallenge: true,
performanceConfig: PerformanceConfig.balanced(),
);
// After converting CameraImage → InputImage → List<Face>:
if (!session.acceptFrame(DateTime.now())) return;
session.markProcessingStarted();
final started = DateTime.now();
final frame = const MlKitFaceAdapter().fromFaces(
faces,
imageSize: Size(width, height),
timestamp: DateTime.now(),
);
final snapshot = session.completeFrame(
frame,
DateTime.now().difference(started),
);
// Use snapshot.signal / snapshot.guidance / session.challenge
Camera → InputImage conversion lives in the host app (lib/services/camera_liveness_session.dart). The package stays UI-free and camera-agnostic.
Layout #
example/lib/
app.dart # routes + Material theme
services/camera_liveness_session.dart
screens/ # disclaimer, demos, audit, diagnostics
widgets/accessible_guidance_banner.dart