'page view inside sliver to box adapter. flutter

i want a page view inside sliver to box adapter.

 SliverToBoxAdapter(
        child:  PageView.builder(
                  itemBuilder: (context, position) {
                    return Column(
                      children: [
                        Container(
                          height: 260,
                          color: Colors.cyan,
                        ), 
                      ],
                    );
                  },
                ),
         
            ),

All pages inside the page view must scroll without height according to widgets. my error is, Null check operator used on a null value. RenderBox was not laid out: RenderRepaintBoundary#2dd7a relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1930 pos 12: 'hasSize'



Solution 1:[1]

That just means, your PageView is unbound. Try this:

SliverToBoxAdapter(
    child: SizedBox(
        height: 250,
        child: PageView.builder(...)
    ),
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 leopragi