flutter_reprint 1.0.3 flutter_reprint: ^1.0.3 copied to clipboard
A plugin to use Reprint in Flutter apps. Reprint is a fingerprint authentication library for Android that supports older devices (for example, Samsung S5 and Xiaomi Redmi 3).
flutter_reprint #
A plugin that allows you to use Reprint in Flutter apps.
Installing #
To use this plugin, follow the steps below:
-
add
flutter_reprint
as a dependency in your pubspec.yaml file. -
add
Reprint
as a dependency in youryour_flutter_app_main_dir/android/app/build.gradle
file:
dependencies {
(...)
implementation 'com.github.ajalt.reprint:core:3.3.2@aar'
}
- Add
Reprint.initialize(this)
to your application classonCreate
method:
class YourApplication : FlutterApplication() {
override fun onCreate() {
super.onCreate()
Reprint.initialize(this) }
}
If you do not have an application class, you'll need to create one. Don't forget to add it to your AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.marcoporcho.my_app">
<application android:name=".application.YourApplication"
(...)
>
- Add the USE_FINGEPRINT permission to your
AndroidManifest.xml
file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.marcoporcho.my_app">
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
Getting Started #
You can check out the example
directory for a sample app using flutter_reprint
.
For the impatient:
Check if the device has fingerprint hardware
bool fingerprintReaderAvailable = await FlutterReprint.canCheckFingerprint;
Authenticate
FlutterReprint.authenticateWithBiometrics().then((authResult) {
if(authResult.success) {
print('SUCCESS');
} else {
print('FAIL');
}
});
Stop authentication
FlutterReprint.stopAuthentication().then((cancelOK) {
if(cancelOK) {
print('SUCCESS');
} else {
print('FAIL');
}
});