OndrejKunc / flutter_dynamic_forms

A collection of flutter and dart libraries allowing you to consume complex external forms at runtime.
MIT License
203 stars 59 forks source link

Reset value of element to original json value. Follow-up of #71 #72

Closed JohnPinto closed 4 years ago

JohnPinto commented 4 years ago

Hi, I've implemented your suggestion (#71) of using the isVisibleChanged stream to reset my custom component's value. But I'm currently having a problem with the stream itself, the two states that I'm receiving in the async snapshot from the StreamBuilder are true and null, I never get a false indicating that the form element that I'm trying to reset is not visible.

Even when I'm using the isVisible property, It returns true or null. If I print the output from the properyChanged stream I also have the same outcome, never "isVisible", only null or "value". My problem at the moment is that I want to reset the value when the form element is hidden, but It's resetting when it becomes visible a second time, if I use the .getFormData() the hidden component's value is still being outputted.

Thanks for the previous reply, and sorry to bother you a second time.