GuardoExtensions extension

Extension on BuildContext to provide convenient authentication helpers

on

Properties

guardoState → GuardoState?

Available on BuildContext, provided by the GuardoExtensions extension

Gets the current authentication state
no setter
isAppLocked → bool

Available on BuildContext, provided by the GuardoExtensions extension

Checks if the app is currently locked
no setter
isAuthenticated → bool

Available on BuildContext, provided by the GuardoExtensions extension

Checks if the app is currently authenticated
no setter

Methods

canAuthenticate({GuardoService? guardoService}) → Future<bool>

Available on BuildContext, provided by the GuardoExtensions extension

Checks if biometric authentication is available on the device
getAvailableBiometrics({GuardoService? guardoService}) → Future<List<BiometricType>>

Available on BuildContext, provided by the GuardoExtensions extension

Gets the list of available biometric types
guardoActionWithResult<T>({required T onSuccess(), T onFailure(Object exception)?, String? reason, GuardoConfig? config, GuardoService? guardoService}) → Future<T?>

Available on BuildContext, provided by the GuardoExtensions extension

Protects an action with biometric authentication and returns a result
guardoAsyncAction({required Future<void> onSuccess(), Future<void> onFailure(Object exception)?, String? reason, GuardoConfig? config, GuardoService? guardoService}) → Future<void>

Available on BuildContext, provided by the GuardoExtensions extension

Protects an async action with biometric authentication
guardoAsyncActionWithResult<T>({required Future<T> onSuccess(), Future<T> onFailure(Object exception)?, String? reason, GuardoConfig? config, GuardoService? guardoService}) → Future<T?>

Available on BuildContext, provided by the GuardoExtensions extension

Protects an async action with biometric authentication and returns a result
hasAuthenticationMethods({GuardoService? guardoService}) → Future<bool>

Available on BuildContext, provided by the GuardoExtensions extension

Checks if any authentication methods are available on the device
isDeviceSupported({GuardoService? guardoService}) → Future<bool>

Available on BuildContext, provided by the GuardoExtensions extension

Checks if the device supports biometric authentication
isGuardoEnabled() → bool

Available on BuildContext, provided by the GuardoExtensions extension

Checks if Guardo authentication is currently enabled
lockApp() → Future<void>

Available on BuildContext, provided by the GuardoExtensions extension

Locks the app immediately by showing the lock screen
resetLockTimer() → void

Available on BuildContext, provided by the GuardoExtensions extension

Resets the lock timer, extending the time before automatic lock
secureAction({required VoidCallback onSuccess, void onFailure(Object exception)?, String? reason, GuardoConfig? config, GuardoService? guardoService}) → Future<void>

Available on BuildContext, provided by the GuardoExtensions extension

Protects an action with biometric authentication
unlockApp() → Future<bool>

Available on BuildContext, provided by the GuardoExtensions extension

Attempts to unlock the app using biometric authentication