length static method

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

Ensures the string length falls within the specified range.

Implementation

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