NumericValidationController constructor

NumericValidationController({
  1. String message = 'Text must be a number',
  2. bool required = false,
})

Implementation

NumericValidationController(
    {String message = 'Text must be a number', bool required = false})
    : super(
          message: message,
          isValid: ({controller}) {
            String? textValue = controller?.rawValue?.toString();
            if (!required && TextUtils.isEmpty(textValue)) return true;
            return num.tryParse(textValue!) != null;
          });