hasMinSpecialChar method

bool hasMinSpecialChar(
  1. String password,
  2. int specialCount
)

Implementation

bool hasMinSpecialChar(String password, int specialCount) {
  String pattern =
      r"^(.*?[$&+,\:;/=?@#|'<>.^*()_%!-]){" + specialCount.toString() + ",}";
  return password.contains(new RegExp(pattern));
}