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