title: Dropdown button not showing selected value in Flutter
body: <p>I am new to Flutter development and I'm trying to show the selected value of a dropdown but I can't get it to work.</p>
  
  <p>The dropdown doesn't show it as the chosen one, it just continues as though nothing was selected. Please help me to solve the problem.</p>
  
  <p>Here is my code</p>
  
  <pre><code>    import 'dart:convert';
      import 'package:sqlliteapp/db_helper.dart';
      import 'package:sqlliteapp/user_model.dart';
      import 'package:http/http.dart' as http;
  
      import 'package:flutter/material.dart';
  
      class SqliteDropdown extends StatefulWidget {
        @override
        SqliteDropdownState createState() {
          return new SqliteDropdownState();
        }
      }
  
      class SqliteDropdownState extends State&lt;SqliteDropdown&gt; {
        DatabaseHelper db = DatabaseHelper();
  
        //Add data to db
        _saveData() async {
          UserModel user1 = UserModel(
            "test",
            "test",
            "test@gmail.com",
            "test",
          );
  
          UserModel user2 = UserModel(
            "test1",
            "test1",
            "test1@gmail.com",
            "test",
          );
          await db.saveData(user1);
          await db.saveData(user2);
        }
  
        @override
        void initState() {
          super.initState();
          _saveData();
        }
  
        UserModel _currentUser;
  
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            appBar: AppBar(
              title: Text('Fetching data from Sqlite DB - DropdownButton'),
            ),
            body: Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                mainAxisSize: MainAxisSize.max,
                children: &lt;Widget&gt;[
                  FutureBuilder&lt;List&lt;UserModel&gt;&gt;(
                      future: db.getUserModelData(),
                      builder: (BuildContext context,
                          AsyncSnapshot&lt;List&lt;UserModel&gt;&gt; snapshot) {
                        if (!snapshot.hasData) return CircularProgressIndicator();
                        return DropdownButton&lt;UserModel&gt;(
                          items: snapshot.data
                              .map((user) =&gt; DropdownMenuItem&lt;UserModel&gt;(
                                    child: Text(user.name),
                                    value: user,
                                  ))
                              .toList(),
                          onChanged: (UserModel value) {
                            setState(() {
                              _currentUser = value;
                            });
                          },
                          isExpanded: true,
                          //value: _currentUser,
                          hint: Text('Select User'),
                        );
                      }),
                  SizedBox(height: 20.0),
                  _currentUser != null
                      ? Text(
                          "Name: " +
                              _currentUser.name +
                              "\n Email: " +
                              _currentUser.email +
                              "\n Username: " +
                              _currentUser.username +
                              "\n Password: " +
                              _currentUser.password,
                        )
                      : Text("No User selected"),
                ],
              ),
            ),
          );
        }
      }
  </code></pre>
  
  <p>dropdown doesn't show it as the chosen one, it just keeps like if nothing was selected.Please support me to solve the problem</p>