title: setState() or markNeedsBuild called during build
body: <pre><code>class MyHome extends StatefulWidget {
    @override
    State&lt;StatefulWidget&gt; createState() =&gt; new MyHomePage2();
  }
  
  class MyHomePage2 extends State&lt;MyHome&gt; {
    List items = new List();
  
    buildlist(String s) {
      setState(() {
        print(&quot;entered buildlist&quot; + s);
        List refresh = new List();
        if (s == 'button0') {
          refresh = [
            new Refreshments(&quot;Watermelon&quot;, 250),
            new Refreshments(&quot;Orange&quot;, 275),
            new Refreshments(&quot;Pine&quot;, 300),
            new Refreshments(&quot;Papaya&quot;, 225),
            new Refreshments(&quot;Apple&quot;, 250),
          ];
        } else if (s == 'button1') {
          refresh = [
            new Refreshments(&quot;Pina Colada&quot;, 250),
            new Refreshments(&quot;Bloody Mary&quot;, 275),
            new Refreshments(&quot;Long Island Ice tea&quot;, 300),
            new Refreshments(&quot;Screwdriver&quot;, 225),
            new Refreshments(&quot;Fusion Cocktail&quot;, 250),
          ];
        } else if (s == 'button2') {
          refresh = [
            new Refreshments(&quot;Virgin Pina Colada&quot;, 250),
            new Refreshments(&quot;Virgin Mary&quot;, 275),
            new Refreshments(&quot;Strawberry Flush&quot;, 300),
            new Refreshments(&quot;Mango Diver&quot;, 225),
            new Refreshments(&quot;Peach Delight&quot;, 250),
          ];
        } else {
          refresh = [
            new Refreshments(&quot;Absolute&quot;, 250),
            new Refreshments(&quot;Smirnoff&quot;, 275),
            new Refreshments(&quot;White Mischief&quot;, 300),
            new Refreshments(&quot;Romanov&quot;, 225),
            new Refreshments(&quot;Blender's Pride&quot;, 250),
          ];
        }
  
        for (var item in refresh) {
          items.add(new ItemsList(item));
        }
      });
    }
  
    @override
    Widget build(BuildContext context) {
      var abc = MediaQuery.of(context).size;
  
      print(abc.width);
  
      var width = abc.width / 4;
  
      Text text = new Text(&quot;Dev&quot;);
      Text text2 = new Text(&quot;Sneha&quot;);
      Text text3 = new Text(&quot;Prashant&quot;);
      Text text4 = new Text(&quot;Vikesh&quot;);
  
      var pad = const EdgeInsets.all(10.0);
  
      Padding pad1 = new Padding(child: text, padding: pad);
      Padding pad2 = new Padding(child: text2, padding: pad);
      Padding pad3 = new Padding(child: text3, padding: pad);
      Padding pad4 = new Padding(child: text4, padding: pad);
  
      ListView listView = new ListView(children: &lt;Widget&gt;[
        new Image.asset('images/party.jpg'),
        pad1,
        pad2,
        pad3,
        pad4
      ]);
  
      Drawer drawer = new Drawer(child: listView);
  
      return new Scaffold(
        drawer: drawer,
  
        appBar: new AppBar(
          title: new Text('Booze Up'),
        ),
        body: new Column(children: &lt;Widget&gt;[
          new ListView.builder(
            scrollDirection: Axis.horizontal,
            itemCount: 4,
            itemBuilder: (BuildContext context, int index) {
              return new Column(children: &lt;Widget&gt;[
                new Container(
                  child: new Flexible(
                      child: new FlatButton(
                    child: new Image.asset('images/party.jpg',
                        width: width, height: width),
                    onPressed: buildlist('button' + index.toString()),
                  )),
                  width: width,
                  height: width,
                )
              ]);
            },
          ),
          new Expanded(
              child: new ListView(
            padding: new EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 10.0),
            children: items,
            scrollDirection: Axis.vertical,
          )),
        ]),
  
        floatingActionButton: new FloatingActionButton(
          onPressed: null,
          child: new Icon(Icons.add),
        ), // This trailing comma makes auto-formatting nicer for build methods.
      );
    }
  }
  
  class Refreshments {
    String name;
    int price;
  
    Refreshments(this.name, this.price);
  }
  
  class ItemsList extends StatelessWidget {
    final Refreshments refreshments;
  
    ItemsList(this.refreshments);
  
    @override
    Widget build(BuildContext context) {
      return new ListTile(
        onTap: null,
        title: new Text(refreshments.name),
      );
    }
  }
  </code></pre>
  <p><a href="https://dartpad.dartlang.org/45ebdf271cf45e20a7ad5f5564742517" rel="noreferrer">Full code</a></p>
  <p>I am having two errors:</p>
  <p>1] Horizontal viewport was given unbounded height .
  A horizontal viewport was given an unlimited amount of vertical space in which to expand.</p>
  <p>2] setState() or markNeedsBuild called during build
  A vertical renderflex overflowed by 99488 pixels.</p>
  <p>Please help me with it . I am creating this app where on each image click a list should be shown below . The images will be in a row and the list should be shown below the row.</p>
  <p>Thank you.</p>