Skip to main content

face_liveness_verification 0.2.1 copy "face_liveness_verification: ^0.2.1" to clipboard
face_liveness_verification: ^0.2.1 copied to clipboard

Flutter package for real-time face liveness challenges and FaceNet-based identity verification with configurable matching.

example/main.dart

import 'package:face_liveness_verification/face_liveness_verification.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const FaceLivenessExampleApp());
}

class FaceLivenessExampleApp extends StatelessWidget {
  const FaceLivenessExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'face_liveness_verification example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF0EA5E9)),
        useMaterial3: true,
      ),
      home: const ExampleHomePage(),
    );
  }
}

class ExampleHomePage extends StatelessWidget {
  const ExampleHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    final uiState = FaceLivenessUiState(
      message: 'Align your face and perform the action shown',
      ringColor: Colors.orange,
      isCompleted: false,
      isValidFace: true,
      phase: FaceValidationPhase.detection,
      nextAction: FaceLivenessAction.blink,
    );

    return Scaffold(
      appBar: AppBar(title: const Text('face_liveness_verification')),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: Center(
          child: AspectRatio(
            aspectRatio: 3 / 4,
            child: FaceLivenessUi(
              preview: Container(
                decoration: const BoxDecoration(
                  gradient: LinearGradient(
                    begin: Alignment.topCenter,
                    end: Alignment.bottomCenter,
                    colors: [Color(0xFF1F2937), Color(0xFF111827)],
                  ),
                ),
                alignment: Alignment.center,
                child: const Icon(
                  Icons.face_6_rounded,
                  size: 84,
                  color: Colors.white70,
                ),
              ),
              state: uiState,
            ),
          ),
        ),
      ),
    );
  }
}
1
likes
0
points
205
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter package for real-time face liveness challenges and FaceNet-based identity verification with configurable matching.

Repository (GitHub)
View/report issues

Topics

#flutter #biometrics #face-recognition #authentication #face-detection

License

unknown (license)

Dependencies

flutter, google_mlkit_face_detection, image, tflite_flutter

More

Packages that depend on face_liveness_verification