title: How to use the return of function to fill in a DropDownMenu in flutter?
body: <p>I have this method that returns a list filled with items from an api and I want to use it to fill a dropdownmenuItem using this</p>
  <pre><code>data.map((item) {
     return DropdownMenuItem(
              child: Text(
              item['animals_id']),
              value: item['animals_id'],
              );
              }).toList(),
  </code></pre>
  <p>the methode in question that i used to fill that list with from api is</p>
  <pre><code>getIaDetailsByAnimalID() async {
      var response = await http.get(
          Uri.parse(URL +
              '/api/optifarm.ia_detail/?query={animals_id,name,order_animal,date_animal,date_identification_animal,sexe_animal,choix,sur_chaleur,prix,product_id}'),
          headers: {'Cookie': 'session_id=${v.session}'});
      List&lt;IaDetails&gt; data = [];
      var mJson = json.decode(response.body)['result'];
      if (response.statusCode == 200) {
        for (var item in mJson) {
          data.add(IaDetails.fromJson(item));
        }
        return data;
      }
    }
  </code></pre>
  <p>I want to use the same data in this &quot;List data = [];&quot; to fill the dropdownmenuItems</p>
  <p>I'm still new to dart/flutter development so I appreciate any help given</p>