flutter_biometrics 0.3.0 copy "flutter_biometrics: ^0.3.0" to clipboard
flutter_biometrics: ^0.3.0 copied to clipboard

Flutter plugin which lets you to generate key pair and do cryptographic signing using biometric authentication.

flutter_biometrics #

Documentation is under contruction.

Flutter plugin which lets you to generate key pair and do cryptographic signing using biometric authentication.

Heavily influenced by local_auth

Usage in Dart #

Import the relevant file:

import 'package:flutter_biometrics/flutter_biometrics.dart';
copied to clipboard

Available methods:

bool authAvailable =
    await FlutterBiometrics().authAvailable();
copied to clipboard
List<BiometricType> getAvailableBiometricTypes =
    await FlutterBiometrics().getAvailableBiometricTypes();
copied to clipboard
String publicKeyAsBase64 =
    await FlutterBiometrics().createKeys(reason: 'Please authenticate to generate keys');
copied to clipboard
bool signedPayloadAsBase64 =
    await FlutterBiometrics().sign(payload: 'base64string', reason: 'Please authenticate to sign payload');
copied to clipboard

Android Integration (taken from local_auth) #

Note that local_auth plugin requires the use of a FragmentActivity as opposed to Activity. This can be easily done by switching to use FlutterFragmentActivity as opposed to FlutterActivity in your manifest (or your own Activity class if you are extending the base class).

Update your project's AndroidManifest.xml file to include the USE_FINGERPRINT permissions:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.app">
  <uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<manifest>
copied to clipboard

Getting Started #

For help getting started with Flutter, view Flutter online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

19
likes
130
points
67
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.25 - 2025.04.09

Flutter plugin which lets you to generate key pair and do cryptographic signing using biometric authentication.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, meta

More

Packages that depend on flutter_biometrics