range static method
Implementation
static String? Function(dynamic) range(num min, num max, {String? message}) {
return (value) {
if (value == null || value.toString().isEmpty) return null;
final n = num.tryParse(value.toString());
if (n == null) return "Invalid number";
if (n < min || n > max) {
return (message ?? "Must be between $min and $max");
}
return null;
};
}