title: Reset value of dropdown menu flutter
body: <p>I have two dropdown,Dropdown 1 listout job category Dropdown 2 contains list jobs based on category.when i select dropdown 1 the corresponding data should be show in dropdown 2.</p>
  <p>Everything works fine,but there is problems is when ever i change the value of dropdown1,then the drop down 2 show previous datas everytime with selected data of dropdown,API don't have any problem</p>
  <pre><code> Flexible(
                flex: 0,
                child: Padding(
                  padding: EdgeInsets.only(left: 10, right: 10, top: 15),
                  child: Container(
                    width: double.infinity,
                    height: 45,
                    decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(5),
                        border: Border.all(color: Colors.blueGrey)),
                    child: DropdownButton(
                      isExpanded: true,
                      itemHeight: 50,
                      icon: Icon(Icons.arrow_drop_down),
                      iconSize: 40,
                      underline: SizedBox(),
                      hint: Padding(
                        padding: const EdgeInsets.all(8.0),
                        child: Text(
                          &quot;Job Category&quot;,
                          style: TextStyle(fontSize: 15, color: Colors.black54),
                        ),
                      ),
                      value: _selectedmenu,
                      onChanged: (newValue) {
                        setState(() {
                          _selectedmenu = newValue;
                          print(_selectedmenu);
                          GetWorkCategories();
                        });
                      },
                      items: home_model.map((menu) {
                        return DropdownMenuItem(
                          child: Padding(
                            padding: const EdgeInsets.all(8.0),
                            child: new Text(menu.english),
                          ),
                          value: menu.id,
                        );
                      }).toList(),
                    ),
                  ),
                ),
              ),
              Flexible(
                flex: 0,
                child: Padding(
                  padding: EdgeInsets.only(left: 10, right: 10, top: 15),
                  child: Container(
                    width: double.infinity,
                    height: 45,
                    decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(5),
                        border: Border.all(color: Colors.blueGrey)),
                    child: DropdownButton(
                      isExpanded: true,
                      itemHeight: 50,
                      icon: Icon(Icons.arrow_drop_down),
                      iconSize: 40,
                      underline: SizedBox(),
                      hint: Padding(
                        padding: const EdgeInsets.all(8.0),
                        child: Text(
                          AppLocalization.of(context)
                              .getTranslatedValues('job_text'),
                          style: TextStyle(fontSize: 15, color: Colors.black54),
                        ),
                      ),
                      value: _selectedjobcategory,
                      onChanged: (newValue) {
                        setState(() {
                          _selectedjobcategory = newValue;
                        });
                      },
                      items: job_category_model.map((jobs) {
                        return DropdownMenuItem(
                          child: Padding(
                            padding: const EdgeInsets.all(8.0),
                            child: Text(jobs.english),
                          ),
                          value: jobs.english,
                        );
                      }).toList(),
                    ),
                  ),
                ),
              ),
  </code></pre>
  <p>Dropdown 2 function</p>
  <pre><code> Future&lt;String&gt; GetWorkCategories() async {
      
      Future auth_token = SharedPrefrence().getToken();
      auth_token.then((data) async {
        token = data;
        var response = await http.post(Urls.CATEGORIES,
            headers: {&quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Authorization&quot;: token},
            body: json.encode({&quot;menuId&quot;: _selectedmenu}));
        print(&quot;response menu &quot; + response.body.toString());
  
        Map&lt;String, dynamic&gt; value = json.decode(response.body);
        var message = value['status'];
        try {
          if (response.statusCode == 200) {
            try {
              if (message == true) {
                var menu_list = value['doc'];
                job_category_model.clear();
                for (int i = 0; i &lt; menu_list.length; i++) {
                  var data = menu_list[i];
                  job_category_model.add(CategoryModel.fromJson(data));
                }
                setState(() {
  
                  print(&quot;UI Updated&quot;);
                });
              } else {
                final snackBar = SnackBar(content: Text(message));
                _scaffoldKey.currentState.showSnackBar(snackBar);
              }
            } catch (e) {
              e.toString();
            }
          } else {
            final snackBar = SnackBar(content: Text(message));
            _scaffoldKey.currentState.showSnackBar(snackBar);
          }
        } catch (e) {
          e.toString();
        }
      });
    }
  </code></pre>