isPasswordValidator method

bool isPasswordValidator({
  1. int minLength = 6,
  2. int uppercaseCharCount = 0,
  3. int lowercaseCharCount = 0,
  4. int numericCharCount = 0,
  5. int specialCharCount = 0,
})

default minimum value 6 check password give true and false

Implementation

bool isPasswordValidator(
    {int minLength = 6,
    int uppercaseCharCount = 0,
    int lowercaseCharCount = 0,
    int numericCharCount = 0,
    int specialCharCount = 0}) {
  if (isEmptyOrNull) return false;
  if (this!.contains(' ')) return false;
  if (minLength != 0 &&
      !Validator.hasMinimumLength(this!, minLength == 0 ? 6 : minLength)) {
    return false;
  }
  if (uppercaseCharCount != 0 &&
      !Validator.hasMinimumUppercase(this!, uppercaseCharCount)) {
    return false;
  }
  if (lowercaseCharCount != 0 &&
      !Validator.hasMinimumLowercase(this!, lowercaseCharCount)) {
    return false;
  }
  if (numericCharCount != 0 &&
      !Validator.hasMinimumNumericCharacters(this!, numericCharCount)) {
    return false;
  }
  if (specialCharCount != 0 &&
      !Validator.hasMinimumSpecialCharacters(this!, specialCharCount)) {
    return false;
  }
  return true;
}