hasMinNumericChar method

bool hasMinNumericChar(
  1. String password,
  2. int numericCount
)

Checks if password has at least numericCount numeric character matches

Implementation

bool hasMinNumericChar(String password, int numericCount) {
  String pattern = '^(.*?[0-9]){' + numericCount.toString() + ',}';
  return password.contains(new RegExp(pattern));
}