byteLength static method

String? Function(String?) byteLength(
  1. int min, {
  2. int? max,
  3. String errorMessage = 'Length is out of range',
})

Ensures the string's UTF-8 byte length falls within a range.

Implementation

static String? Function(String?) byteLength(
  int min, {
  int? max,
  String errorMessage = 'Length is out of range',
}) {
  return _build(errorMessage, (v) => v.isByteLength(min, max));
}