numberValidator function

String? numberValidator(
  1. String? text
)

Implementation

String? numberValidator(String? text) {
  if (text != null) {
    if (double.tryParse(text) == null) {
      return 'Ingrese caracteres numéricos';
    } else {
      return null;
    }
  }
  return null;
}