between static method
Validates that the input is between min and max.
Implementation
static String? Function(String) between(num min, num max, {String? message}) {
return (value) {
if (value.trim().isEmpty) return null;
final num = double.tryParse(value);
if (num == null) return 'Please enter a valid number.';
if (num < min || num > max) {
return message ?? 'Value must be between $min and $max.';
}
return null;
};
}