-
-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 3, is customized validation supported? #44
Comments
Ooh yeah. The fields have an attribute named FormBuilderTextField(
attribute: "age",
decoration: InputDecoration(labelText: "Age"),
validators: [
FormBuilderValidators.numeric(),
FormBuilderValidators.max(70)
FormBuilderValidators.min(18, errorText: "You can't be under 18.")
],
), P.S. I'm currently working on comprehensive documentation. |
That means we can create our own customized FormBuilderValidator right? |
Sure. Or alternatively just stick in your validator function inside the list of validators, like so: FormBuilderTextField(
attribute: "over_18",
decoration: InputDecoration(labelText: "Are you over 18?"),
validators: [
FormBuilderValidators.required(),
(val){
if(val != "Yes")
return "The answer must be Yes";
},
],
), |
The validator function just has to be of type |
I see, that's cool....great job! Thank you very much! |
I'm glad you appreciate it. |
Hi @danvick , does version 3 still support for custom validator?
Suppose I have a text field with some customize validation, can it still be done now?
The text was updated successfully, but these errors were encountered: