title: Flutter: DropdownButton SetState not functional
body: <p>i have a DropDownButton, which is filled from an SQLite DB which is ok for my app for now. But after choosing an entry, the DropDownButton didnt show the choosen entry, just the hint. To check my entry i try to fill a textfield also with the choosen entry, but this isnt changed too. Here is my code for the DropDownButton:</p>
  <pre><code>  List&lt;DropdownMenuItem&lt;String&gt;&gt; teamList;
    DropdownMenuItem selectedTeam;
  
    DropdownButton(
            hint: Text(&quot;Choose&quot;),
            value: selectedTeam,
            onChanged: (value) {
              setState(() {
                _teamController.text = value.name;
                selectedTeam = value;
              });
            },
            items: teamList,
          ),
  </code></pre>
  <p>actually i fill my teamList with a codesnippet  inside the initstate:</p>
  <pre><code>super.initState();
  
  teamList = [];
  db.getData().then((listMap) {
    listMap.map((map) {
      print(map.toString());
      return getDropDownWidget(map);
    }).forEach((dropDownMenuItem) {
      teamList.add(dropDownMenuItem);
    });
    setState(() {});
  });
  </code></pre>
  <p>and with this:</p>
  <pre><code>DropdownMenuItem&lt;String&gt; getDropDownWidget(Map&lt;String, dynamic&gt; map) {
    return DropdownMenuItem&lt;String&gt;(
      value: map['team'],
      child: Text(map['team']),
  );
  </code></pre>
  <p>}</p>
  <p>in my dbhelper-file i have this code:</p>
  <pre><code>Future&lt;List&lt;Map&lt;String, dynamic&gt;&gt;&gt; getData() async {
  var dbClient = await db;
  return await dbClient.rawQuery('SELECT team FROM teamTable');
  </code></pre>
  <p>}</p>