verifyPassword method

void verifyPassword(
  1. String password
)

Implementation

void verifyPassword(String password) {
  if (isLockedOut.value) {
    AppUtils.showSnackBar('You are temporarily locked out. Please wait.');
    return;
  }

  if (password == correctPassword) {
    isScreenUnlocked.value = true;
    failedAttempts.value = 0;
  } else {
    failedAttempts.value++;
    if (failedAttempts.value >= 5) {
      startLockout();
    } else {
      AppUtils.showSnackBar('Invalid Password. ${5 - failedAttempts.value} attempts remaining.');
    }
  }
}