Skip to content
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

Accept errorText as callback and pass validation parameters to the callback function #199

Closed
e200 opened this issue Dec 11, 2019 · 3 comments
Labels
enhancement New feature or request invalid This doesn't seem right

Comments

@e200
Copy link

e200 commented Dec 11, 2019

Accept errorText as callback and pass validation parameters to the callback function so people can dynamically return a different text error message with the required values.

FormBuilderTextField(
       attribute: 'last_name',
       maxLines: 1,
       decoration: InputDecoration(labelText: 'Último nome'),
       validators: [
            FormBuilderValidators.minLength(
                     3,
                     errorText: (value, minLength) {
                          return `${value} must be greater then ${minLength}`;
                     },
             ],
       ),
)
@danvick
Copy link
Collaborator

danvick commented May 7, 2020

Hi @e200,
This sounds like a nice idea.

However, it would be a bit challenging to pull off on this package based on the implementation of FormFieldValidator.

@danvick danvick added the enhancement New feature or request label May 7, 2020
@danvick danvick added the invalid This doesn't seem right label Jul 18, 2020
@danvick danvick closed this as completed Jul 18, 2020
@e200
Copy link
Author

e200 commented Jul 18, 2020

:(

@danvick
Copy link
Collaborator

danvick commented Jul 18, 2020

I know. I'm sorry.

PR welcome though. Or get some votes on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants