You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Composed forms are ideal when you need to manage multiple instances of the same form. The number of forms doesn’t need to be known in advance — new instances can be added or removed at any time.
7
+
8
+
The core building block of this system is the `GladeComposedModel`, which maintains and manages a list of individual `GladeModel` or even another `GladeComposedModel` instances contained within the composed form.
9
+
10
+
Because `GladeComposedModel` extends `ChangeNotifier`, any dependent widgets automatically rebuild when the model changes.
11
+
12
+
**Using a composed model**
13
+
14
+
Composed models behave just like ordinary `GladeModel` objects — they are even provided with the same `GladeModelProvider` and consumed with `GladeFormBuilder`:
Whenever any contained form model changes — or a model is added or removed — the entire composed form builder rebuilds to reflect the updated list.
35
+
36
+
**Rendering multiple identical forms**
37
+
38
+
Since all form models within a composed model share the same type, it's often helpful to automatically generate the same form widget for each model. This is where `GladeComposedListBuilder` comes in. It iterates through all models and builds the appropriate form widget for each one.
0 commit comments