isGuardoEnabled method
Checks if Guardo authentication is currently enabled
Returns true if authentication is enabled and functioning normally, false if it's disabled or bypassed for any reason.
Example usage:
if (context.isGuardoEnabled()) {
// Authentication is active
await context.lockApp();
} else {
// Authentication is disabled or bypassed
print('Guardo is currently disabled');
}
Implementation
bool isGuardoEnabled() {
final guardoState = _findGuardoStateNotifier();
if (guardoState == null) return false;
// If the state is BypassedState, Guardo is effectively disabled
return guardoState.state is! BypassedState;
}