title: how to get selected index of dropdownbutton in flutter
body: <p>How to get selectedIndex of dropdown in flutter,</p>
  
  <p>In dropdownbutton there is no property to get selected index, if there how to get the selected index and my code look like this:</p>
  
  <pre><code>new DropdownButton( hint:new Text("Select a users"),value: selectedUser,
  
                onChanged: (String newValue) {
                  setState(() {
                    selectedUser = newValue;
                  });
                },
                items: userInfoToMap.map((ListOfUsers value) {
                  return new DropdownMenuItem&lt;String&gt;(
                      value: value.name,
                      child:new Text(value.name,style: new TextStyle(color: Colors.black))
                  );
                })
                    .toList(),
              ),
  
            ),),
  </code></pre>