numeric static method
Validates only numbers
Implementation
static String? Function(String?) numeric({String? message}) {
return (String? value) {
if (value == null || value.trim().isEmpty) {
return null;
}
if (!RegExp(r'^[0-9]+$').hasMatch(value)) {
return message ?? _defaultMessages['numeric'];
}
return null;
};
}