minLength static method

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

Validates a minimum length.

Implementation

static String? minLength(String? value, int length, {String? message}) {
  if (value == null || value.trim().isEmpty) return null;
  if (value.length >= length) return null;
  return message ?? 'Must be at least $length characters';
}