maxValue static method
Creates a validation rule that enforces a maximum numeric value.
Returns an error message if the value exceeds max.
If message is not provided, uses a default message.
Example:
Validations.maxValue(100, 'Value cannot exceed 100')
Implementation
static String Function(double?) maxValue(double max, [String? message]) {
return (double? value) => (value ?? double.infinity) > max ? message ?? 'Value must be at most $max' : '';
}