numeric static method
Validate numeric value
Implementation
static String? numeric(String? value, {String? fieldName}) {
if (value == null || value.isEmpty) {
return '${fieldName ?? 'This field'} is required';
}
final numericValue = double.tryParse(value);
if (numericValue == null) {
return '${fieldName ?? 'This field'} must be a valid number';
}
return null;
}