LockController class

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)

Constructors

LockController({VoidCallback? onUnlockCallback, VoidCallback? onLockCallback})

Properties

hashCode int
The hash code for this object.
no setterinherited
onLockCallback VoidCallback?
Optionally register a callback that gets triggered every time the app is locked (e.g., for analytics purposes)
final
onUnlockCallback VoidCallback?
Optionally register a callback that gets triggered every time the app is unlocked (e.g., for analytics purposes)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state Stream<LockState>
The stream of LockState where the last entry is always the current state of the app
latefinal

Methods

lock({required List<BiometricMethod> availableMethods}) → void
Results in displaying lock screen overlay. Intended to be triggered by the Authenticator, but could also be triggered manually, i.e., from your application's code. In case there's a need to trigger the lock screen manually, keep in mind that this will create a non-dismissable overlay that can only be removed by authenticating with the correct pin / biometrics. For this reason it is important to never trigger lock method manually if authentication is not enabled. Triggering the lock screen manually will not persist accross sessions. availableMethods refer to BiometricMethods that the device supports, or an empty list if the device doesn't support biometrics or the user has not opted in to using it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
unlock() → void
Results in dismissing the lock screen overlay and making the app contents visible. Probably shouldn't be used manually, unless there's a really good reason to. It was intended to be used by the pin_lock package internally

Operators

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