PasscodeBiometricAuthUI class

Implementers

Constructors

PasscodeBiometricAuthUI({String prefix = 'PasscodeBiometricAuth', String sha256Passcode = '', bool isUseBiometric = false, bool forceCreatePasscode = true, String title = 'Passcode', CheckConfig checkConfig = const CheckConfig(), CreateConfig createConfig = const CreateConfig(), RepeatConfig repeatConfig = const RepeatConfig(), double blurSigma = 15, void onMaxRetriesExceeded()?, Future<bool> onForgotPasscode(BuildContext context, PasscodeBiometricAuthUI authUI)?, OnRead? onRead, OnWrite? onWrite, HapticFeedbackType hapticFeedbackType = HapticFeedbackType.lightImpact, Widget dialogBuilder(BuildContext context, String title, Widget content, List<Widget>? actions)?})
An UI to show the passcode and biometric authentication dialogs.

Properties

blurSigma double
Blur sigma for the background.
final
checkConfig CheckConfig
Config for the check dialog.
final
createConfig CreateConfig
Config for the create dialog.
final
dialogBuilder Widget Function(BuildContext context, String title, Widget content, List<Widget>? actions)?
The AlertDialog will be used by default. If you want to modify the dialog, you can use this builder.
final
forceCreatePasscode bool
If this value is true, the app requests to create a passcode if it's unavailable. If false, the app only requests to create a passcode if the biometric authentication is unavailable in the device.
final
hapticFeedbackType → HapticFeedbackType
The vibration type when user types.
final
hashCode int
The hash code for this object.
no setterinherited
isUseBiometric Future<bool>
Check whether the app is using biometric.
no setter
onForgotPasscode Future<bool> Function(BuildContext context)?
This method is called when users tap the forgot your passcode button. We usually use a dialog to show the cautions when users want to reset their passcode. The passcode will be removed if this method returns true.
latefinal
onMaxRetriesExceeded → void Function()?
This callback will be triggered when users reach the maximum number of retries.
final
onRead OnRead?
All configuration that needs to be read from the local database will be called through these methods.
final
onWrite OnWrite?
All configuration that needs to be write to the local database will be called through these methods.
final
prefix String
Prefix for saving to local database in OnRead and OnWrite.
final
repeatConfig RepeatConfig
Config for the repeat dialog.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sha256Passcode Future<String>
Get the current passcode in SHA256. There is no way to get the raw passcode.
no setter
title String
Main title of all dialogs.
final

Methods

authenticate(BuildContext context, {bool? forceCreatePasscode, bool? isUseBiometric}) Future<bool>
This method will automatically handles both passcode and biometric authentications.
authenticateWithBiometric() Future<bool>
Manually authenticate via biometric authentication.
authenticateWithPasscode(BuildContext context) Future<bool>
Manually authenticate via passcode authentication.
changePasscode(BuildContext context) Future<bool>
Change the passcode.
isAvailablePasscode() FutureOr<bool>
Check whether the passcode is available.
isBiometricAvailable() Future<bool>
Check whether biometric authentication is available on the current device.
isPasscodeAuthenticated(String code) Future<bool>
Check whether the passcode code is correct.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removePasscode() Future<void>
Remove the current passcode.
toString() String
A string representation of this object.
inherited
useBiometric(bool isUse) Future<void>
Set the isUseBiometric value.

Operators

operator ==(Object other) bool
The equality operator.
inherited