title: Flutter - DropdownButtonFormField value not updating
body: <p>My Dropdown button value doesn't update until the AlertDialog box is closed and reopened.</p>
  
  <p>I have the variable set at the top of my class</p>
  
  <pre class="lang-dart prettyprint-override"><code>class _ItemListState extends State&lt;ItemList&gt; {
    int _ratingController;
  ...
  
  }
  </code></pre>
  
  <p>Within the class I have an AlertDialog that opens a form, within here I have the DropdownButtonFormField</p>
  
  <pre class="lang-dart prettyprint-override"><code>
  AlertDialog(
        content: Column(
          mainAxisSize: MainAxisSize.min,
          children: &lt;Widget&gt;[
            TextField(
              controller: _eateryController,
              autofocus: true,
              decoration:
                  InputDecoration(labelText: 'Eatery', hintText: 'eg Pizza Hut'),
            ),
            TextField(
              controller: _supplierController,
              decoration: InputDecoration(
                  labelText: 'Supplier', hintText: 'eg Deliveroo'),
            ),
            TextField(
              controller: _descriptionController,
              decoration: InputDecoration(
                  labelText: 'Description', hintText: 'eg cheese pizza'),
            ),
            DropdownButtonFormField&lt;int&gt;(
              value: _ratingController,
              items: [1, 2, 3, 4, 5]
                  .map((label) =&gt; DropdownMenuItem(
                        child: Text(label.toString()),
                        value: label,
                      ))
                  .toList(),
              hint: Text('Rating'),
              onChanged: (value) {
                setState(() {
                  _ratingController = value;
                });
              },
            ),
          ],
        ),
        actions: &lt;Widget&gt;[
          FlatButton(
            onPressed: () {
              _handleSubmit(_eateryController.text, _supplierController.text,
                  _descriptionController.text, _ratingController);
              Navigator.pop(context);
            },
            child: Text('Save'),
          ),
          FlatButton(
            onPressed: () =&gt; Navigator.pop(context),
            child: Text('Cancel'),
          )
        ],
      );
  </code></pre>
  
  <p>the setState doesn't seem to be dynamically updating the fields value.  The updated value will only show once I close and re open the AlertDialog.</p>
  
  <p>How can I get this to update instantly?</p>
  
  <p>Thanks</p>