DEV Community

Discussion on: Why use Reactive Forms in Flutter?

Collapse
 
zacharias02 profile image
John Lester D. Necesito

Hi! Can I ask if it is possible to add a dynamic reactive text field to a form?

Collapse
 
joanpablo profile image
Joan Pablo

Hi John Lester,

I've just released v6.0.0.

In this version like in the previous one, you can add controls to a group with the method FormGroup.addAll(). This method receives a Map of controls as arguments. In this version the disrty/pristine state of the group is updated and it also triggers the onCollectionChanges event.

Collapse
 
joanpablo profile image
Joan Pablo

Hi Jhon,

Right now there is a method FormGroup.addAll() that receives a collection of FormControls and append them as children. But maybe is not what you're asking for.

So I will add that as an issue in the GitHub repo and I will bring the possibility to add a single control FormGroup.add() and that action will trigger an event of type FormControlCollection.collectionChanges.

I will release it in next version.

Thanks again.