hasMinimumNumericCharacters method

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

Implementation

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