check if the string's length (in bytes) falls in a range.
bool isByteLength(String str, int min, [int? max]) { return str.length >= min && (max == null || str.length <= max); }