simple_local_auth 0.1.1 copy "simple_local_auth: ^0.1.1" to clipboard
simple_local_auth: ^0.1.1 copied to clipboard

A Flutter plugin for local biometric authentication with clean API and detailed error handling.

๐Ÿ›ก๏ธ Simple Local Auth #

A lightweight and developer-friendly Flutter plugin to authenticate users using local biometric methods such as Fingerprint, Face ID, and other platform-specific mechanisms.

โœจ Features #

  • Check biometric hardware availability
  • Detect enrolled biometrics
  • Support for Fingerprint and Face ID
  • Simple API to trigger biometric authentication
  • Smooth integration for Android and iOS

๐Ÿ“ฆ Installation #

Add the package to your pubspec.yaml:

dependencies:
  simple_local_auth: ^1.0.0

Then run:

flutter pub get

โš™๏ธ Platform Setup #

Android #

  1. Update your android/app/build.gradle:
minSdkVersion 23
  1. Add permissions to AndroidManifest.xml (usually not required, but ensure biometric support is enabled):
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>

iOS #

  1. Add the following to your Info.plist:
<key>NSFaceIDUsageDescription</key>
<string>This app uses Face ID to authenticate the user</string>
  1. Ensure your app has a Deployment Target of iOS 11.0+ in ios/Podfile.

๐Ÿš€ Getting Started #

Import the package #

import 'package:simple_local_auth/simple_local_auth.dart';
import 'package:simple_local_auth/models/auth_results.dart';

Check Biometric Availability #

final availability = await SimpleLocalAuth.getAvailabilityDetails();
if (availability.hasHardware && availability.hasEnrolledBiometrics) {
  // Safe to prompt for authentication
}

Authenticate User #

final result = await SimpleLocalAuth.authenticate(
  reason: 'Please authenticate to proceed',
  cancelButton: 'Cancel',
);

if (result.success) {
  // Authentication successful
} else {
  // Handle failure
}

๐Ÿงช Example App #

A full-featured example is included in the example/ directory.

Run it:

cd example
flutter run

The app shows:

  • Biometric availability
  • Authentication status
  • Feedback on success/failure

๐Ÿ“ท UI Preview #

โœ… Capabilities Checked #

  • Hardware Availability โœ…
  • Biometrics Enrolled โœ…
  • Fingerprint Support โœ…
  • Face ID Support โœ…

๐Ÿ“Œ Notes #

  • On some Android devices, users must manually enroll biometrics.
  • On iOS, make sure Face ID/Touch ID is configured in device settings.

๐Ÿค Contributing #

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a new branch
  3. Submit a pull request with a clear description

๐Ÿ“„ License #

MIT License


Built with โค๏ธ by [Tamremariam Belete].


1
likes
145
points
8
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for local biometric authentication with clean API and detailed error handling.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on simple_local_auth

Packages that implement simple_local_auth