maxLength static method
Validates that the value has maximum length
Example:
Validators.maxLength(value, 100);
Implementation
static String? maxLength(String? value, int maxLength, {String? message}) {
if (value == null || value.isEmpty) return null;
if (value.length > maxLength) {
return message ?? 'Must be at most $maxLength characters';
}
return null;
}