PasscodeBiometricAuthUICached class

A variant of PasscodeBiometricAuthUI that automatically caches configuration values using SharedPreferences.

This implementation provides default onRead and onWrite methods that persist configuration data (booleans, strings, and integers) using SharedPreferences. For scenarios requiring more secure storage, consider using PasscodeBiometricAuthUI without caching.

Inheritance

Constructors

PasscodeBiometricAuthUICached.new({String prefix = 'PasscodeBiometricAuth', String salt = '', 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)?, HapticFeedbackType hapticFeedbackType = HapticFeedbackType.lightImpact, Widget dialogBuilder(BuildContext context, String title, Widget content, List<Widget>? actions)?})
A variant of PasscodeBiometricAuthUI that automatically caches configuration values using SharedPreferences.

Properties

blurSigma double
Blur intensity for the background when dialogs are shown.
finalinherited
checkConfig CheckConfig
Configuration options for the passcode validation dialog.
finalinherited
createConfig CreateConfig
Configuration options for creating a new passcode.
finalinherited
dialogBuilder Widget Function(BuildContext context, String title, Widget content, List<Widget>? actions)?
Custom builder for dialog widgets.
finalinherited
forceCreatePasscode bool
Determines if the app must force the creation of a passcode when it is missing.
finalinherited
hapticFeedbackType → HapticFeedbackType
Type of haptic feedback for UI interactions.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
isUseBiometric Future<bool>
Indicates if biometric authentication is enabled.
no setterinherited
onForgotPasscode Future<bool> Function(BuildContext context)?
Callback invoked when "forgot your passcode" is selected.
latefinalinherited
onMaxRetriesExceeded → void Function()?
Callback executed when the maximum retry attempt threshold is exceeded.
finalinherited
onRead OnRead?
Callback to read saved configuration from local storage.
finalinherited
onWrite OnWrite?
Callback to write configuration to local storage.
finalinherited
prefix String
Prefix used when storing configuration data.
finalinherited
repeatConfig RepeatConfig
Configuration options for confirming the newly created passcode.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
salt String
The salt used to enhance the passcode security. (Defaults to an empty string.)
finalinherited
sha256Passcode Future<String>
Retrieves the current passcode in SHA256 hash format.
no setterinherited
title String
Title displayed across all dialogs.
finalinherited

Methods

authenticate(BuildContext context, {bool? forceCreatePasscode, bool? isUseBiometric}) Future<bool>
Authenticates the user with biometric and/or passcode verification.
inherited
authenticateWithBiometric() Future<bool>
Initiates biometric authentication using available device sensors.
inherited
authenticateWithPasscode(BuildContext context) Future<bool>
Displays the passcode input dialog for authentication.
inherited
changePasscode(BuildContext context) Future<bool>
Allows the user to change the current passcode.
inherited
isAvailablePasscode() FutureOr<bool>
Determines if a passcode has already been set.
inherited
isBiometricAvailable() Future<bool>
Checks if biometric authentication is available on this device.
inherited
isPasscodeAuthenticated(String code) Future<bool>
Validates the provided passcode by comparing its SHA256 hash.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removePasscode() Future<void>
Removes the stored passcode and related authentication configurations.
inherited
toString() String
A string representation of this object.
inherited
useBiometric(bool isUse) Future<void>
Updates the user's preference for biometric authentication.
inherited

Operators

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