LocalAuthenticationRepository class abstract

Used to store values between sessions. pin_lock comes with SharedPreferences implementation out of the box, but it is possible to provide your own implementation (e.g., using encrypted storage library instead) by implementing LocalAuthenticationRepository interface and passing it to Authenticator.instance()

Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addFailedAttempt(DateTime timestamp, {required UserId forUser}) Future<void>
Adds timestamp to the list of failed authentication attempts of user with forUser id
clearLastPausedTimestamp() Future<void>
Clear the last paused timestamp, e.g., when the app has been successfully unlocked
disableBiometricAuthentication({required UserId userId}) Future<void>
Disables only biometric authentication, while keeping the pin. To also disable pin authentication, use disableLocalAuthentication
disableLocalAuthentication({required UserId userId}) Future<void>
Writes to the repository the preference of the user with userId to not show lock screen This includes both pin and biometric authentication
enableBiometricAuthentication({required UserId userId}) Future<void>
enablePinAuthentication({required Pin pin, required UserId userId}) Future<void>
Writes to the repository the user's preference to have local authentication enabled with the given pin, for the user with userId
getListOfFailedAttempts({required UserId userId}) Future<List<DateTime>>
Gets a list of DateTime timestamps of all the previous failed authentication attempts (i.e., times when a wrong pincode was entered)
getPausedTimestamp() Future<DateTime?>
Get timestamp of when the app became paused to determine if sufficient time has passed for it to be locked
getPin({required UserId forUser}) Future<PinHash?>
Returns the PinHash of the user with forUser id, or null if no pin is set
isBiometricAuthenticationEnabled({required UserId userId}) Future<bool?>
User's preference of if they want to use biometric authentication
isPinAuthenticationEnabled({required UserId userId}) Future<bool?>
Used to determine if the lock screen should be shown
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetFailedAttempts({required UserId ofUser}) Future<void>
Clears the list of failed authentication attempts ofUser
savePausedTimestamp(DateTime time) Future<void>
Saves the timestamp when the app became paused (i.e., lost focus), so that the app could be locked if the user has been away from it for longer than Authenticator.lockAfterDuration
setPin(Pin newPin, {required UserId forUser}) Future<void>
Set the newPin for user with forUser id
toString() String
A string representation of this object.
inherited

Operators

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