title: PageView.builder giving Horizontal viewport was given unbounded height error
body: <p>I'm very new to flutter and I'm trying to learn how to create views. I tried to create a separate file of the view, or widget if that's what it's called in flutter, and just call it from the main.dart.</p>
  
  <p>I have a separate widget containing this code</p>
  
  <pre><code>class PageEntryWidgetMain extends StatefulWidget {
    final PageViewEntryMain pageViewEntryMain;
  
    const PageEntryWidgetMain({Key key, this.pageViewEntryMain})
        : super(key: key);
  
    @override
    State&lt;StatefulWidget&gt; createState() {
      return _PageEntryWidgetMainState();
    }
  }
  
  class _PageEntryWidgetMainState extends State&lt;PageEntryWidgetMain&gt; {
    @override
    Widget build(BuildContext context) {
      return Container(
        child: Row(
          children: &lt;Widget&gt;[
            Text(widget.pageViewEntryMain.title)
          ],
        ),
      );
    }
  }
  </code></pre>
  
  <p>and I'm trying to show it by using a view pager with the following code</p>
  
  <pre><code>return Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              PageView.builder(
                itemBuilder: (context, position) {
                  PageEntryWidgetMain(
                    pageViewEntryMain: pages[position],
                  );
                },
                itemCount: pages.length,
                scrollDirection: Axis.horizontal,
              )
            ],
          ),
        ),
      );
  </code></pre>
  
  <p>but it gives me the following errors</p>
  
  <ul>
  <li>Horizontal viewport was given unbounded height.</li>
  <li>Viewports expand in the cross axis to fill their container and constrain their children to match their extent in the cross axis. In this case, a horizontal viewport was given an unlimited amount of vertical space in which to expand.</li>
  </ul>
  
  <p>I'm a little confused at what it's actually complaining of. I am able to display just one view, by replacing the PageView.builder with this code</p>
  
  <pre><code>PageEntryWidgetMain(pageViewEntryMain: pages[0])
  </code></pre>
  
  <p>So I believe that the separate widget, in itself, does not have a problem. It's probably about how I am trying to use the ViewPager that's giving me errors.</p>
  
  <p>I have been searching for PageView implementations but I have not seen one that actually has a separate view to just call for displaying. I need to learn it this way so I would be able to separate the views instead of just writing it all in one file.</p>