PositiveDecimalValidationController constructor

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

Implementation

PositiveDecimalValidationController(
    {String message = 'Text must be a decimal positive number',
    bool required = false})
    : super(
          message: message,
          isValid: ({controller}) {
            String? textValue = controller?.rawValue?.toString();
            if (!required && TextUtils.isEmpty(textValue)) return true;
            num? value = num.tryParse(textValue!);
            return (value ?? -1) >= 0;
          });