face_liveness_verifier 1.0.0
face_liveness_verifier: ^1.0.0 copied to clipboard
A Flutter plugin for face liveness detection with randomized challenges to verify real human presence through facial movements.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:face_liveness_verifier/face_liveness_verifier.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Face Liveness Verifier')),
body: Center(
child: ElevatedButton(
onPressed: () async {
final path = await FaceLivenessVerifierPlugin.instance
.startLivenessDetection(
context: context,
config: LivenessConfig(
isEnableMaxBrightness: true,
durationLivenessVerify: 60,
showDurationUiText: false,
startWithInfoScreen: false,
customLabels: {
LivenessChallenge.blink: '👁️ Parpadea',
LivenessChallenge.lookLeft: '⬅️ Izquierda',
LivenessChallenge.lookRight: '➡️ Derecha',
LivenessChallenge.lookUp: '⬆️ Arriba',
LivenessChallenge.lookDown: '⬇️ Abajo',
LivenessChallenge.smile: '😀 Sonríe',
},
),
isEnableSnackBar: true,
shuffleChallenges: true,
isDarkMode: false,
showCurrentChallenge: true,
);
debugPrint('Captured image path: $path');
},
child: const Text('Start Liveness Detection'),
),
),
),
);
}
}