PositiveDecimalValidationController constructor
PositiveDecimalValidationController({})
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;
});