maxLength static method
Validates a maximum length.
Implementation
static String? maxLength(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 most $length characters';
}