title: Insert dropdown select into database in flutter
body: <p>I want to enter data from the dropdown menu into the database, but when using this code all data does not enter the database, like there is something wrong with this code.this is the code to display the dropdown</p>
  
  <pre><code>FutureBuilder(
      future: ClientController.getClient(),
      builder: (context, snapshot) {
      if (snapshot.hasData) {
          return new DropdownButton(
              hint: Text('Pilih Company'),
              value: _selectedClient,
              items: snapshot.data
                  .map&lt;DropdownMenuItem&gt;((value) {
                      return DropdownMenuItem(
                          value: value,
                          child: Text(value["name"]),
                      );
                  }).toList(),
              onChanged: (value) {
                  setState(() {
                      _selectedClient = value;
                  });
              },
          );
      } else {
          return CircularProgressIndicator();
      }
  }),
  </code></pre>
  
  <p>and this code to enter into the database</p>
  
  <pre><code>if (result) {
      final response = await UserController.register({
          "username": txtUsername.text,
          "password": txtPassword.text,
          "email": txtEmail.text,
          "full_name": txtFullName.text,
          "company": _selectedClient,
      });
  
      if (response != null &amp;&amp; response["success"]) {
          setState(() {});
      }
  }
  </code></pre>