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