title: Flutter - How to make PageView & ListView?
body: <p>I'm trying to make a Carousel using PageView, PageController and ListView from this <a href="https://stackoverflow.com/questions/51607440/horizontally-scrollable-cards-with-snap-effect-in-flutter">Horizontally scrollable cards with Snap effect in flutter</a>. But it throwed this exception...</p>
  
  <p><em>══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
  I/flutter (17678): The following assertion was thrown during performResize():
  I/flutter (17678): Horizontal viewport was given unbounded height.
  I/flutter (17678): Viewports expand in the cross axis to fill their container and constrain their children to match
  I/flutter (17678): their extent in the cross axis. In this case, a horizontal viewport was given an unlimited amount of
  I/flutter (17678): vertical space in which to expand.</em></p>
  
  <p>Can someone help me to fix it?</p>
  
  <p>I want to add this Carousel inside of Stack-filled with background image, transform class, and fade transition.</p>
  
  <pre><code>  @override
    void initState() {
     super.initState();
      controller = PageController(
       initialPage: 0,
       keepPage: true,
      );
  
   @override
    Widget build(BuildContext context) {
  
      return AnimatedBuilder(
          builder: (BuildContext context, Widget child) {
           return Scaffold(
             //BODY
            body: ListView(children: &lt;Widget&gt;[
              new Stack(
                children: &lt;Widget&gt;[
                  new AspectRatio(...),
                  new Transform(...),
                  //THIS IS
                  new ListView.builder(
                    itemCount: 3,
                    scrollDirection: Axis.horizontal,
                    padding: EdgeInsets.symmetric(vertical: 16.0),
                    itemBuilder: (BuildContext context, int index) {
                      if (index % 3 == 0) {
                        return _buildCarousel(context, index ~/ 3);
                      } else {
                        return Divider();
                      }
                    },
                  ),
              }
           }
     }
     Widget _buildCarousel(BuildContext context, int carouselIndex) {
      return Column(
       mainAxisSize: MainAxisSize.min,
       children: &lt;Widget&gt;[
         Text('Carousel $carouselIndex'),
         SizedBox(
         // you may want to use an aspect ratio here for tablet support
           height: 200.0,
           child: PageView.builder(
          // store this controller in a State to save the carousel scroll position
           controller: PageController(viewportFraction: 0.8),
           itemBuilder: (BuildContext context, int itemIndex) {
             return _buildCarouselItem(context, carouselIndex, itemIndex);
           },
         ),
       )
     ],
   );
    Widget _buildCarouselItem(
      BuildContext context, int carouselIndex, int itemIndex) {
       return Padding(
       padding: EdgeInsets.symmetric(horizontal: 4.0),
         child: Container(
          decoration: BoxDecoration(
          color: Colors.grey,
          borderRadius: BorderRadius.all(Radius.circular(4.0)),
        ),
      ),
    );
  </code></pre>
  
  <p><strong>This is the full code <a href="https://pastebin.com/xXRkaWuR" rel="nofollow noreferrer">https://pastebin.com/xXRkaWuR</a></strong></p>