Skip to content
PROSENJIT-RONIPublic

About

Test app showcasing every feature of the flutter_face_liveness package — liveness actions, Face ID, anti-spoof, video replay detection, and a custom quick-scan + live monitoring flow.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Face Liveness — Full Feature Test 🛡️📷

A complete, production-ready Flutter application built to demonstrate the full capabilities of the flutter_face_liveness (v3.6.0) package.

This project serves as a practical, real-world reference implementation. It shows developers exactly how to wire up the flutter_face_liveness package into a beautifully structured, fully responsive app using modern Flutter architectural patterns.

🔍 What You Can Explore in This App

This app isn't just a simple demo—it's a comprehensive testing sandbox for the flutter_face_liveness package. By running this app, you can test and interact with the following package features directly from the UI:

1. ⚡ Custom Flows (LivenessController)

See how to use the underlying LivenessController for purely customized UI experiences.

  • Quick Scan: A custom screen that detects a face and holds it for 1 second (pure presence detection) without requiring any blinks or smiles.
  • Live Monitor: A custom screen that continuously streams the camera and triggers a red "No face detected" warning banner the moment the user steps out of frame.

2. 🎭 Liveness Action Challenges

Test how the package handles different verification challenges to ensure a live human is in front of the camera:

  • Quick Check: Lowest friction (Blink only).
  • Standard Verification: Blink · Turn Left · Turn Right.
  • Extended Challenge: Blink · Look Up · Look Down · Smile.
  • Full Challenge: All 7 supported actions including Open Mouth.

3. 🧠 Face Identity (Face ID) Engine

Test the package's local, offline Face Recognition pipeline. The app lets you toggle between ML Kit, YOLOv8, and SCRFD detector backends on the fly.

  • Auto Mode: Matches known faces, automatically registers new ones.
  • Registration Only: Strict one-time enrollment that rejects duplicate/already registered faces.
  • Verification Only: Secure login flow that only accepts previously registered faces and never registers unknowns.
  • (Includes a UI card to view all currently registered Face ID strings and a button to clear the local database).

4. 🛑 Advanced Anti-Spoofing & Replay Protection

Test the package's robust security models designed to defeat presentation attacks:

  • TFLite Deepfake Detection: Leverages a lightweight FaceAntiSpoofing model to catch printed photos or screen playbacks.
  • 8-Signal Video Replay Detection: Uses MiniFASNet-V2 combined with pure-Dart heuristic signals to specifically catch video replay attacks.
  • Maximum Protection: Run Liveness Actions + Face ID + Deepfake Detection + Video Replay all at the exact same time.

5. 📸 Best-Frontal Capture

See how the package can automatically evaluate frame quality during the session and extract a perfectly cropped, upright, high-quality JPEG of the user's face upon a successful verification.

🛠️ Tech Stack & Architecture

  • State Management & Routing: get (GetX) for clean, imperative routing.
  • Responsive UI: flutter_screenutil_plus for pixel-perfect scaling across phones and tablets without hardcoded dimensions.
  • Camera Permissions: permission_handler.
  • Architecture: Clean, modular structure separating resources (themes, strings, colors), routes, services, and UI components.

Folder Structure

lib/
 ┣ resources/
 ┃ ┣ app_colors.dart      # Centralized color palette
 ┃ ┣ app_theme.dart       # ThemeData configurations
 ┃ ┣ m_strings.dart       # All user-facing text/constants
 ┃ ┗ res.dart             # Asset paths (e.g., logos)
 ┣ routes/
 ┃ ┗ app_routes.dart      # GetX Route definitions
 ┣ screens/
 ┃ ┣ home_screen.dart     # Main menu & feature toggles
 ┃ ┣ live_monitor_screen.dart
 ┃ ┣ liveness_screen.dart # Core flutter_face_liveness wrapper
 ┃ ┣ quick_scan_screen.dart
 ┃ ┗ splash_screen.dart   # Animated logo entrance
 ┣ service/
 ┃ ┗ app_initializer.dart # Startup configuration block
 ┣ widgets/
 ┃ ┗ test_tile.dart       # Reusable UI components
 ┗ main.dart              # App bootstrap

🚀 Getting Started

Prerequisites

  • Flutter SDK (^3.12.2 or higher)
  • Dart 3.4+ compatible environment

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/facelive.git
    cd facelive
  2. Install dependencies:

    flutter pub get

    Note: This project includes a specific dependency_override for tflite_flutter pulling from GitHub main to ensure compatibility with Dart 3.4+, as required by the liveness package.

  3. Run the app:

    flutter run

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

📝 License

This project is open-source and available under the MIT License.

About

Test app showcasing every feature of the flutter_face_liveness package — liveness actions, Face ID, anti-spoof, video replay detection, and a custom quick-scan + live monitoring flow.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages