isLength function
check if the length of the string str
falls in a range
Implementation
bool isLength(String str, int min, [int? max]) {
final List surrogatePairs = _surrogatePairsRegExp.allMatches(str).toList();
final int len = str.length - surrogatePairs.length;
return len >= min && (max == null || len <= max);
}