minLength static method

String? minLength(
  1. String? value,
  2. int minLength, {
  3. String? errorMessage,
})

Implementation

static String? minLength(String? value, int minLength,
    {String? errorMessage}) {
  if (value == null || value.length < minLength) {
    return errorMessage ?? 'Minimum length is $minLength characters';
  }
  return null;
}