title: How to build a dynamic list in Flutter?
body: <p>I have this widget attached to a <code>Scaffold</code> body. The widget gets a <code>async</code> method that returns a json object.</p>
  
  <p>I want to build a list, dynamically, from that json object. The problem is that the screen is empty.. For some reason this widget needs to refresh itself when the list is ready or something like that.</p>
  
  <p>Any ideas? </p>
  
  <pre><code>class TestList extends StatelessWidget {
    final quiz;
  
    TestList({this.quiz});
  
    @override
    Widget build(BuildContext context) {
      var listArray = [];
  
      this.quiz.then((List value) {   // this is a json object
  
        // loop through the json object
        for (var i = 0; i &lt; value.length; i++) {
  
          // add the ListTile to an array
          listArray.add(new ListTile(title: new Text(value[i].name));
  
        }
      });
  
      return new Container(
          child: new ListView(
        children: listArray     // add the list here.
      ));
    }
  }
  </code></pre>