maxValue static method
Validates that a numeric value is less than a maximum
Example:
Validators.maxValue('10', 20);
Implementation
static String? maxValue(String? value, num max, {String? message}) {
if (value == null || value.isEmpty) return null;
final numValue = num.tryParse(value);
if (numValue == null || numValue > max) {
return message ?? 'Value must be at most $max';
}
return null;
}