guardoState property

GuardoState? get guardoState

Gets the current authentication state

Returns the current GuardoState or null if not in a Guardo context.

Example usage:

final state = context.guardoState;
switch (state) {
  case CheckingState():
    // Show loading
  case AuthenticatedState():
    // Show authenticated content
  case LockScreenState():
    // Show lock screen
  // ... handle other states
}

Implementation

GuardoState? get guardoState {
  final guardoStateNotifier = _findGuardoStateNotifier();
  return guardoStateNotifier?.state;
}