A simple Flutter application that showcases the biometric authentication process. This app demonstrates how to implement biometric authentication using the device's built-in capabilities.
- Flutter
- Dart
- Implements biometric authentication (fingerprint and facial recognition).
- Provides a user-friendly interface to demonstrate the authentication process.
To run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/biometric-authentication.git cd biometric-authentication
-
Install dependencies:
flutter pub get
-
Run the app:
flutter run
lib/
βββ auth/
β βββ widgets/
β β βββ auth.dart # Widgets for authentication logic
βββ core/ # Core utilities or base classes
βββ data/ # Data layer (repositories, data sources)
βββ database/ # Database logic
βββ domain/
β βββ entities/
β β βββ account_entity.dart # Entity representing account data
β βββ usecases/
β β βββ add_account.dart # Use case for adding an account
β β βββ delete_account.dart # Use case for deleting an account
β β βββ get_accounts.dart # Use case for retrieving accounts
βββ presentation/
β βββ pages/
β β βββ add_account_page.dart # UI page for adding an account
β β βββ home_page.dart # UI for the home page
β β βββ mainscreen.dart # Main screen of the app
β βββ widgets/ # Widgets for UI
βββ service/
β βββ encryption_handler.dart # Logic for encryption
β βββ generate_key.dart # Key generation logic for encryption
β βββ local_auth.dart # Local authentication logic (e.g., biometrics)
βββ main.dart # Entry point of the app
The app uses the Local Authentication Plugin to access biometric sensors like fingerprint or face ID. Upon launching the app, users can tap a button to initiate biometric authentication. If the device supports biometrics and the user has registered their biometrics (e.g., fingerprint), the app prompts the user to authenticate.
If the authentication is successful, a success message is displayed.
If the authentication fails, an error message is shown.
Make sure biometric authentication is enabled on your device:
Android: Go to Settings > Security > Fingerprint/Face Unlock to enable biometrics.
iOS: Go to Settings > Face ID & Passcode or Settings > Touch ID & Passcode.