minLength static method

String? minLength(
  1. String? value,
  2. int min, [
  3. String? fieldName
])

Implementation

static String? minLength(String? value, int min, [String? fieldName]) {
  final name = fieldName ?? 'This field';
  if (value == null || value.trim().length < min) {
    return '$name must be at least $min characters.';
  }
  return null;
}