title: How can I call method in setState() (Flutter)?
body: <p>I tried to call a method in <code>setState()</code> for updating data.
  But I got this error:</p>
  <pre><code>There should be exactly one item with [DropdownButton]'s value: 3. 
  Either zero or 2 or more [DropdownMenuItem]s were detected with the same value
  'package:flutter/src/material/dropdown.dart':
  Failed assertion: line 915 pos 15: 'items == null || items.isEmpty || value == null ||
    items.where((DropdownMenuItem&lt;T&gt; item) { return item.value == value;
  }).length == 1'
  </code></pre>
  <p><img src="https://i.stack.imgur.com/xSaeq.png" alt="enter image description here" /></p>
  <p>I just want to update a data. because I fetch my data only on initState.</p>
  <p>And this is my code about it.</p>
  <pre><code>Future&lt;String&gt; getProductData() async {
  String url = 'http://172.30.1.6/product.php?id='+_customerSelection;
  var res = await http.get(Uri.parse(url));
  var resBody = json.decode(res.body);
  
    setState((){
    productData = resBody;
  });
  
  print(url);
  
  return &quot;Success&quot;;
  }
  
  final customers = Container(
    child: Row(
      children: [
        Row(
          children: &lt;Widget&gt;[
            Container(
              padding: EdgeInsets.only(left:5),
              child: Text('Customer :')
            )
          ],
        ),
        Row(
          children: &lt;Widget&gt;[Container(
              padding: EdgeInsets.only(left:5),
              child: new DropdownButton(
                value: _customerSelection,
                items: customerData.map((product) {
                  return new DropdownMenuItem(
                      value: product[&quot;CustomerID&quot;].toString(),
                      child: new Text(product[&quot;CustomerName&quot;]!)
                  );
                }).toList(),
                onChanged: (String? newValue) {
                  setState(() {
                    _customerSelection = newValue!;
                    getProductData();
                  });
                },
                hint: Text('Customer'),
              )
          ),
          ],
        )
      ],
    )
  );
  </code></pre>
  <p>So I just want to call method using setState()</p>