pin_lock library

Classes

AuthenticationSetupWidget
A widget that controls the setup of local authentication. The builders passed as parameters to this widget describe what the UI should look like at each step of the setup. AuthenticationSetupWidget takes care of invoking appropriate builders so that the app only takes care of what the setup should look like, while the package takes care of the logic behind it.
Authenticator
AuthenticatorWidget
Root widget of the part of the app that needs to be protected by the pin. Takes the app's Authenticator as a parameter and makes sure that a lock screen is shown as a non-dismissable overlay when the app should be locked.
Available
ChangingPinConfiguration
Provides information needed to draw a screen through which the user can change their password
DisablingPinConfiguration
Provides information necessary to draw the screen through which the user can disable the pin that they have already set up before. It requires the correct pin to be entered in order to disable it.
EnablingPinConfiguration
Provides information necessary for drawing a screen through which the user sets up their pin
HashedValue
Stores given text as a sha256 hash
LocalAuthenticationRepository
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()
LocalAuthenticationRepositoryImpl
LockController
Keeps track of the lock state of the app while it's active. It allows registering callbacks that will get triggered when the app is locked/unlocked (e.g., for analytics purposes)
Locked
LockScreenConfiguration
Provides information needed to draw the Lock Screen, such as the pin input widget that needs to be placed on the LockScreen and available biometric methods that can be used to draw a correct icon on biometric authentication button
LockState
OverviewConfiguration
Provides information necessary to draw a screen with the overview of the current state of local authentication (e.g., whether pin is enabled and whether the device has biometric authentication capabilities), as well as the callbacks used to make the screen interactive (e.g., requesting password change)
Pin
A HashedValue of pinText
PinHash
A hash of the pin. Unlike Pin, PinHash is retrieved from local storage and has no direct contact with the plaintext version of the pin. It's used to compare hash values of newly entered Pin and the one from local storage.
PinInputWidget
PinLock
SPKey
A helper class that makes a sha256 hash of the key used to store pin and userId values
Unavailable
Unlocked
UserId
A HashedValue of the userId

Enums

BiometricMethod
InputFieldState
Describes the state of the given pin input field
LocalAuthFailure

Typedefs

LockScreenBuilder = Widget Function(LockScreenConfiguration configuration)
Descibes the UI of the lock screen given the LockScreenConfiguration
PinInputBuilder = Widget Function(int index, InputFieldState state)
Gives an interface to which pin input widgets should conform You decide what the input widgets should look like, based on the InputFieldState and the position (index) of the field. Input fields will be drawn in a Row
SplashScreenBuilder = Widget Function()