passwordValidationWithSpecialCharacters static method

dynamic passwordValidationWithSpecialCharacters(
  1. String password,
  2. int minPasswordLength,
  3. int maxPasswordLength,
  4. String passRegExp,
)

Implementation

static passwordValidationWithSpecialCharacters(String password,int minPasswordLength,int maxPasswordLength,String passRegExp){
  bool status=false;
  //checking password field is empty or not
  if(password.isNotEmpty) {
    //checking wheather the password length with in range or not
    if ((password.length > minPasswordLength) &&
        (password.length < maxPasswordLength)) {
      //validating password with regular expressions
      if (RegExp(passRegExp).hasMatch(password)) {
        status = true;
      }
      else {
        status = false;
      }
    }
    else {
      status = false;
    }
  }
    return status;
}