This is a fork of the local_auth
There is an open Pull Request to merge into bases local_auth package.
Addresses issue: #49703
The original plugin only supports biometric authentication. This package add a method that allows for device credentials if biometric authentication is not available.
localAuth.authenticate()
behaves the same as the original plugin's localAuth.authenticateWithBiometrics()
but also allows device credentials (pin, pattern, passcode) to be use.
final LocalAuthentication auth = LocalAuthentication();
// API 23 and up with security features enabled for Android
// Any iOS device
bool isSupported = await auth.isDeviceSupported();
final LocalAuthentication auth = LocalAuthentication();
authenticated = await auth.authenticate(
localizedReason: 'Let OS determine authentication method',
useErrorDialogs: true,
stickyAuth: true);
final LocalAuthentication auth = LocalAuthentication();
bool isBiometricsAvailable = await auth.canCheckBiometrics();
final LocalAuthentication auth = LocalAuthentication();
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Biometrics only',
useErrorDialogs: true,
stickyAuth: true);