Package selection guidance compiled from public package information, community data, and project usage.
BiometricX is a Flutter package that simplifies the integration of biometric authentication—such as fingerprint or face recognition—into Android apps. It provides a straightforward API to check biometric availability and authenticate users securely using device-level biometrics. Designed for ease of use, it abstracts complex platform-specific implementations, allowing developers to implement secure authentication with minimal code. The package supports Android only and leverages native biometric APIs for reliable performance and security.
Use cases
Secure app login
User identity verification
Protected data access
Session re-authentication
Two-factor authentication
Key features
Simple API for biometric checks
Android-only support
Secure biometric authentication
Automatic fallback handling
Minimal setup required
Suitable for
Apps requiring secure user authentication
Developers seeking quick biometric integration
Projects focused on Android security
Mobile apps with sensitive data
Prototypes needing fast biometric testing
Considerations
Limited to Android platforms
Requires device biometric hardware
No iOS support
Depends on Android SDK version compatibility
Needs proper permission handling in manifest
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
BiometricX
The easy way to use biometric authentication in your Flutter app.
Supports Fingerprint, FaceID and Iris.
BiometricResult result = awaitBiometricX.encrypt({
biometricKey: 'salkuadrat',
message: 'This is a very secret message',
});
if (result.isSuccess && result.hasData) {
// Keep this messageKey to decrypt your message.// This messageKey will be randomly generated by BiometricX plugin.String messageKey = result.data!;
} else {
showToast(result.errorMsg, context: context);
}
If you need a persistent messageKey, you can supply it as parameter to encrypt.
BiometricResult result = awaitBiometricX.encrypt({
biometricKey: 'salkuadrat',
messageKey: 'secret_message', // use persistent messageKey
message: 'This is a very secret message',
});
if (result.isSuccess && result.hasData) {
// Keep this messageKey to decrypt your message.// This will be the same value as messageKey above ('secret_message')String messageKey = result.data!;
} else {
showToast(result.errorMsg, context: context);
}
To decrypt data using biometric authentication.
// Use the same biometricKey that is used to encrypt your message.// Use messageKey that you get from [BiometricX.encrypt].BiometricResult result = awaitBiometricX.decrypt({
biometricKey: 'salkuadrat',
messageKey: messageKey,
});
if (result.isSuccess && result.hasData) {
// This will contains your original message.String message = result.data!;
} else {
showToast(result.errorMsg, context: context);
}
To show custom message in your biometric prompt, method encrypt and decrypt have parameters you can use to change the biometric prompt dialog.
BiometricResult result = awaitBiometricX.encrypt({
biometricKey: 'salkuadrat',
message: 'This is a very secret message',
title: 'Biometric Encryption',
subtitle: 'Enter biometric credentials to encrypt your message',
description: 'Scan fingerprint or face.',
negativeButtonText: 'USE PASSWORD',
confirmationRequired: true,
});
BiometricResult message = awaitBiometricX.decrypt({
biometricKey: 'salkuadrat',
messageKey: messageKey,
title: 'Biometric Decryption',
subtitle: 'Enter biometric credentials to decrypt your message',
description: 'Scan fingerprint or face.',
negativeButtonText: 'USE PASSWORD',
confirmationRequired: true,
});