minValue static method

String? Function(String?) minValue(
  1. num min, [
  2. String? message
])

Minimum value

Implementation

static String? Function(String?) minValue(num min, [String? message]) {
  return (value) {
    if (value == null || value.isEmpty) return null;
    final num? parsed = num.tryParse(value);
    if (parsed == null || parsed < min) {
      return message ?? 'Must be at least $min';
    }
    return null;
  };
}