SwipeLockProvider class

SwipeLockProvider class to manage swipe lock mechanism.

Mixed-in types

Properties

count → int
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isLocked → bool
Returns true if the swipe action is currently locked.
no setter
lockoutDuration → Duration
no setter
lockoutRemainder → bool
no setter
reader → OnSwipeLockProviderReader
final
remaining ↔ Duration
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
times → int
no setter
writer → OnSwipeLockProviderWriter
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object.
override
isLockedNow([DateTime? now]) → bool
Checks if the swipe action is locked.
limit(int limit) → void
Resets the swipe limit.
lockout(Duration duration) → void
Resets the swipe lockout time.
lockoutRemainderEnable(bool enable) → void
Resets the swipe lockout remainder.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onLocked(OnSwipeLockProviderRemainder remainder) → void
onSwiped(OnSwipeLockProviderCounter counter) → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
Resets the swipe count and lockout time.
swipe([DateTime? now]) → void
Increments the swipe count and checks if the limit is reached. Applies lockout if necessary.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

I → SwipeLockProvider
Returns the singleton instance of SwipeLockProvider.
no setter
i → SwipeLockProvider
Returns the singleton instance of SwipeLockProvider.
no setter
instance → SwipeLockProvider
Returns the singleton instance of SwipeLockProvider. Throws an error if the instance is not initialized.
no setter

Static Methods

init({int times = 5, Duration lockoutDuration = const Duration(hours: 8), DateTime? now, bool lockoutRemainder = true, required OnSwipeLockProviderReader reader, required OnSwipeLockProviderWriter writer, OnSwipeLockProviderCounter? counter, OnSwipeLockProviderRemainder? remainder}) → SwipeLockProvider
Initializes the SwipeLockProvider singleton instance.