title: How to handling controller TextField on expandable Form
body: <p>I'm developing an app on flutter, I'm creating a view that contain form to input student data where is TextField can be expanded as much as needed. So when Icons.add button clicked, additional TextField show up.</p>
  
  <p>And the problem is how to to set unique TextEditingController name for every TextField?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>class _StudentFormState extends State&lt;_StudentForm&gt; {
    final _addStudentForm = GlobalKey&lt;FormState&gt;();
    final _nameController = TextEditingController();
    final _emailController = TextEditingController();
  
    int count = 1;
  
    @override
    Widget build(BuildContext context) {
      List&lt;Widget&gt; children = List.generate(count, (int i) =&gt; _SingleStudent(i));
  
      return Container(
        child: ListView(
          children: &lt;Widget&gt;[
            Form(
              key: _addStudentForm,
              child: Column(
                children: children
              ),
            ),
            IconButton(
              icon: Icon(Icons.add),
              onPressed: () {
                setState(() {
                  count += 1;
                });
              }
            )
          ],
        ),
      );
    }
  }
  
  class _SingleStudent extends StatelessWidget {
    final int index;
  
    _SingleStudent(this.index);
  
    @override
    Widget build(BuildContext context) {
      return Column(
        children: &lt;Widget&gt;[
          TextFormField(
            controller: _nameController[index], // problem here
            decoration: InputDecoration(
              labelText: 'NAME',
            ),
          ),
          TextFormField(
            controller: _emailController, // problem here
            decoration: InputDecoration(
              labelText: 'EMAIL',
            ),
          ),
        ],
      );
    }
  }
  </code></pre>