joanpablo / reactive_forms

This is a model-driven approach to handling form inputs and validations, heavily inspired in Angular's Reactive Forms
MIT License
462 stars 85 forks source link

[Question] How to set form value from parent widget? #413

Open pumano opened 12 months ago

pumano commented 12 months ago

I want to set form via passed object from parent widget and use it in a child form widget via widget.myObject but can't set it to form.

dumikaiya commented 12 months ago

Not sure I understand your question clearly. But I'm guessing this might be an issue with how you're receiving the "form" in the child from the parent, which is not a topic for reactive_forms rather how you have implemented the architecture of your flutter. If you can access the form object from parent in the child then you can just pass it to the formGroup property of ReactiveForm widget.