password static method

FormFieldValidator<String> password({
  1. int minLength = 8,
  2. int maxLength = 32,
  3. int minUppercaseCount = 1,
  4. int minLowercaseCount = 1,
  5. int minNumberCount = 1,
  6. int minSpecialCharCount = 1,
  7. String? errorText,
  8. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field's value to be a valid password.

Parameters:

  • minLength The minimum length of the password (default: 8).
  • maxLength The maximum length of the password (default: 32).
  • minUppercaseCount The minimum number of uppercase characters (default: 1).
  • minLowercaseCount The minimum number of lowercase characters (default: 1).
  • minNumberCount The minimum number of numeric characters (default: 1).
  • minSpecialCharCount The minimum number of special characters (default: 1).
  • errorText The error message when the password is invalid.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

static FormFieldValidator<String> password({
  int minLength = 8,
  int maxLength = 32,
  int minUppercaseCount = 1,
  int minLowercaseCount = 1,
  int minNumberCount = 1,
  int minSpecialCharCount = 1,
  String? errorText,
  bool checkNullOrEmpty = true,
}) => PasswordValidator(
  minLength: minLength,
  maxLength: maxLength,
  minUppercaseCount: minUppercaseCount,
  minLowercaseCount: minLowercaseCount,
  minNumberCount: minNumberCount,
  minSpecialCharCount: minSpecialCharCount,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;