Last updated:
0 purchases
biometric fingerprint
biometric_fingerprint #
A plugin for fingerprint dialog
BIOMETRIC FINGERPRINT
The easy way to use biometric authentication in your Flutter app.
Supports Fingerprint, FaceID and Iris.
Demo example #
Getting Started #
$ flutter pub add biometric_fingerprint
copied to clipboard
Configuration #
Change your android MainActivity to extends FlutterFragmentActivity.
import io.flutter.embedding.android.FlutterFragmentActivity
// kotlin
class MainActivity: FlutterFragmentActivity() {
...
}
copied to clipboard
import io.flutter.embedding.android.FlutterFragmentActivity;
// java
class MainActivity extends FlutterFragmentActivity {
...
}
copied to clipboard
If you got issue in android 8 change in res/values/styles.xml to be like this
<style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- <style name="LaunchTheme" parent="@style/Theme.AppCompat.Light">--> // comment this case
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
copied to clipboard
Usage #
To check biometric type of your device.
BiometricType type = await BiometricFingerprint.type;
copied to clipboard
Here is the list of biometric types.
BiometricType.FACE
BiometricType.FINGERPRINT
BiometricType.IRIS
BiometricType.MULTIPLE
BiometricType.NONE
BiometricType.NO_HARDWARE
BiometricType.UNAVAILABLE
BiometricType.UNSUPPORTED
copied to clipboard
To check if your device can use biometric authentication.
bool isBiometricEnabled = await BiometricFingerprint.isEnabled;
copied to clipboard
To using biometric authentication.
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 = await BiometricFingerprint.initAuthentication({
biometricKey: 'example_key', // example paramter encrypt key
message: 'This is a very secret message', // whatever you want description in dialog
title: 'Biometric Encryption', // whatever you want to write the title
subtitle: 'Enter biometric credentials to encrypt your message', // whatever you want to subtitle
description: 'Scan fingerprint or face.', // whatever you want description in dialog
negativeButtonText: 'USE PASSWORD', // whatever you want make cancel can also "CANCEL"
confirmationRequired: true, // confirmation
});
copied to clipboard
if (result.isSuccess && result.hasData) {
// result success example
String messageKey = result.data!; // up to you make function to do login go head
} else {
print(result.errorMsg);// showing error
}
copied to clipboard
if (result.isFailed) {
//failed case
}
copied to clipboard
if (result.isCanceled) {
//if user cancel / close the dialog biometric or API has been closed
}
copied to clipboard
Case use this plugin for
use case it will be up to you for using on it for login authentication for encrypt or decrypt data with biometric API.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.