title: Flutter: Selected value in dropdown list
body: <p>The initial value in the dialog box doesn't change when I select an item. Here is the code for the dropdown list:</p>
  
  <pre><code>void _buildStatusDialog(String documentID) {
  String _selectedText = "SDD";
  showDialog&lt;void&gt;(
      context: context,
      builder: (BuildContext context) {
        return AlertDialog(
          title: Text("Status Update"),
          content: new DropdownButton&lt;String&gt;(
            hint: Text("Status"),
            value: _selectedText,
            items: &lt;String&gt;['SDD', 'Meeting', 'Home', 'Space']
                .map((String value) {
              return new DropdownMenuItem&lt;String&gt;(
                value: value,
                child: new Text(value),
              );
            }).toList(),
            onChanged: (String val) {
              _selectedText = val;
              setState(() {
                _selectedText = val;
              });
            },
          ),
          actions: &lt;Widget&gt;[
            FlatButton(
              child: Text("UPDATE"),
              onPressed: () {
                .....
              },
            ),
          ],
        );
      });
  </code></pre>
  
  <p>}</p>
  
  <p>How do I update the "hint" or display the selected item? </p>
  
  <p><a href="https://i.stack.imgur.com/6eWAs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6eWAs.png" alt="enter image description here"></a></p>