title: parse JSON data in a flutter
body: <p>I have an error in parse JSON data in a flutter,</p>
  
  <p>I used this API</p>
  
  <p><a href="https://api.covid19api.com/summary" rel="nofollow noreferrer">https://api.covid19api.com/summary</a></p>
  
  <p>and use this website to create the JSON class </p>
  
  <p><a href="https://javiercbk.github.io/json_to_dart/" rel="nofollow noreferrer">https://javiercbk.github.io/json_to_dart/</a></p>
  
  <p>and this code to parse JSON data</p>
  
  <pre><code>Future&lt;List&lt;ListCountries&gt;&gt; _getUsers() async {
  
  var data = await http.get("https://api.covid19api.com/summary");
  var jsonData = json.decode(data.body);
  if (data.statusCode == 200 ) { 
  
    jsonData.forEach((element) {
      countries.add(ListCountries.fromJson(element));
    });
  
    return countries;
    }
  </code></pre>
  
  <p>but it doesn't work, can you help me?</p>
  
  <p>this is all code:
  <a href="https://github.com/faress123/json/blob/master/json" rel="nofollow noreferrer">https://github.com/faress123/json/blob/master/json</a></p>