isByteLength function

bool isByteLength(
  1. String str,
  2. int min, [
  3. int? max
])

Returns true if str byte-length is within `min`, `max`.

Uses String.length as a proxy for byte length.

Implementation

bool isByteLength(String str, int min, [int? max]) {
  return str.length >= min && (max == null || str.length <= max);
}