Open mjarpitanand opened 2 years ago
You can provide custom validators using .add
method like:
ValidationBuilder(optional: true)
..add((value) => (double.tryParse(value) ?? 0.0) < someDoubleValue
? null
: 'Value has to be less than $someDoubleValue');
Callbacks provided to add
method is same as validator
callbacks for TextFormField
which means you return null if validation passes or return error message.
I have a textformfield in which i want user can leave that i.e not required field but if it fill should be less than some double value. I have keyboard formattor to set to digits only.