0

The thing I want to layout is like this enter image description here Because I want the ListView scroll with outside , So I want to make the ListView to the SliverListView .

But this will make the error:

A RenderRepaintBoundary expected a child of type RenderBox but received a child of type RenderSliverList.

What's the best practice to do this kind of layout? do I have to change CustomScrollView to NestedScrollView?

ximmyxiao
  • 2,622
  • 3
  • 20
  • 35

1 Answers1

1

Since SliverListView is a Sliver widget, it can only be the direct child of CustomScrollView. Use it inside the TabBarView will cause the above error since TabBarView expect a RenderBox widget, not a Sliver.

In order to sync the scroll with the CustomScrollView, you can use this property:

ListView(
    physics: NeverScrollableScrollPhysics(),
    // ... other lines
Bach
  • 2,928
  • 1
  • 6
  • 16