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

onSaved missing? #175

Closed
mathieurousseau opened this issue Nov 15, 2019 · 3 comments
Closed

onSaved missing? #175

mathieurousseau opened this issue Nov 15, 2019 · 3 comments

Comments

@mathieurousseau
Copy link

I am usually using regular TextFormField.
I use onSaved to do some treatment only once when saved.

But on FormBuilder, I don't find the onSaved options which execute my code at all changes.

Any way to do like onSaved?

@danvick
Copy link
Collaborator

danvick commented Nov 17, 2019

Hi @mathieurousseau,
Thanks for bringing this up. I'll be including it back shortly.
Here's a few things to note:

  1. If all you need to do is to transform the data before saving you could use the valueTransformer function. A good use-case for this is to transform the value of a numeric TextField from string to a number.
  2. Since we have a transformer when the onSaved will be included in the package, I wouldn't advise using it to make data transformations since the data will already me commited.

@mathieurousseau
Copy link
Author

I am using valueTransformer for what i need but that does not feel right as i don’t transform.

More over, i need to retest but it seemed to be called twice on saving.

@danvick
Copy link
Collaborator

danvick commented Dec 5, 2019

Fixed in v3.7.0. Feel free to reopen in case of any more feedback.

@danvick danvick closed this as completed Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants