AppLock class

Pro app lock: route protection, auto-lock, PIN/biometric, wrong-attempt protection, secure screen, background blur.

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

config AppLockConfig?
Current config if enable was called, otherwise null.
no setter
isLocked bool
Whether the app is currently locked.
no setter

Static Methods

activity() → void
Report user activity to reset auto-lock timer. Call on tap/scroll in sensitive screens.
blockRemaining() Future<Duration?>
Remaining block duration, or null if not blocked.
disable() Future<void>
Disable app lock and clear stored PIN.
enable(AppLockConfig config) Future<void>
Enable app lock with the given config. Call once at app startup (e.g. after WidgetsFlutterBinding.ensureInitialized).
enableBackgroundBlur(bool enable) Future<void>
Enable/disable blur when app is in background (app switcher).
isBlocked() Future<bool>
Whether the user is currently blocked due to too many wrong attempts.
lockNow() → void
Lock the app immediately. Lock screen will show on next AppLockScope check.
protectRoute(String route) → void
Register a route that requires unlock (e.g. '/wallet', '/profile').
protectRoutes(Iterable<String> routes) → void
Register multiple routes that require unlock.
secureScreen(bool enable) Future<void>
Enable/disable screenshot and screen recording protection (Android FLAG_SECURE; iOS blur when captured).
unlock() → void
Programmatic unlock (e.g. after server auth). Prefer PIN/biometric for user unlock.