loginPassword static method

String? loginPassword({
  1. required String password,
  2. String? emptyMessage,
})

Validates a login password by checking if it's not empty.

Simple validation for login forms. For password strength validation during registration, use passwordParts instead.

Parameters:

  • password: The password to validate
  • emptyMessage: Custom message when empty Validates that a password is not empty (basic login validation).

Parameters:

  • password: The password to validate
  • emptyMessage: Custom message for empty input (default: 'Please enter your password.')

Returns null if valid (non-empty), or an error message if invalid.

Example:

final error = SahihValidator.loginPassword(password: input);

Implementation

static String? loginPassword({
  required String password,
  String? emptyMessage,
}) {
  return validateLoginPassword(
    password: password,
    emptyMessage: emptyMessage,
  );
}