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