title: flutter form with nested/reactive model / reactive_forms
body: <p>Going through different tutorials and sources, i'm trying to get a dynamic form in a flutter app, but i'm having a bad time with my use case that looks like advanced.</p>
  <p><strong>What i got working:</strong>
  create a reactiveform with only fixed strings and an int.
  My form for reference:</p>
  <pre class="lang-dart prettyprint-override"><code>final form = fb.group({
      'name': ['',  Validators.required,],
      'category': ['',  Validators.required,],
      'instructions': ['',],
      'unit':  [0,  Validators.required,],
  });
  </code></pre>
  <p>and:</p>
  <pre class="lang-dart prettyprint-override"><code>@override
  Widget build(BuildContext context) {
  ...
  ReactiveForm(
    formGroup: this.form,
    child: Column(
    children: &lt;Widget&gt;[
      ReactiveTextField(
        formControlName: 'name',
        validationMessages: (control) =&gt; {
          ValidationMessage.required:
            'The name must not be empty',
        },
        ...
      ),
    ],
  ),
  </code></pre>
  <p><strong>What i'm trying to achieve with no success:</strong>
  embed another object.The goal is to allow the user to add steps as much as needed, dynamically. So i went the Array&lt; Step &gt; way, but i could not figure how to get it working even with a simple string list...
  It's supposed to work with:</p>
  <pre class="lang-dart prettyprint-override"><code>final form = fb.group({
    ...
    'steps': fb.array([
      'step 1',
      'step 2',
    ]),
  });
  </code></pre>
  <p>And then add a new step to the form with:</p>
  <pre class="lang-dart prettyprint-override"><code>void _addStep(){
    final array = form.control('steps') as FormArray&lt;String&gt;;
    array.add(
    FormControl&lt;String&gt;(value: 'next step'),
    );
  }
  </code></pre>
  <p>The thing is, I have no idea how to create widgets for this, and i can't find examples with arrays.</p>
  <p>I guess i'm supposed to add a ReactiveFormArray() to my build function, but I have no idea how to build something that's supposed to be a single widget with a dynamic list of ReactiveTextField (or just TextFormField, anyway):</p>
  <pre class="lang-dart prettyprint-override"><code>ReactiveFormArray(
    formArrayName: 'steps',
    builder: (BuildContext context, FormArray&lt;dynamic&gt; array, Widget child) {
        **??**
    },
  ),
  </code></pre>
  <p>I tried a lot of things and got my best results using reactive_forms, following <a href="https://pub.dev/packages/reactive_forms" rel="nofollow noreferrer">https://pub.dev/packages/reactive_forms</a>, but i'm open if you have a better solution.</p>
  <p>Hope someone can help me.</p>