how to place a listview inside a SingleChildScrollView but prevent them from scrolling separately?

后端 未结 6 912
我在风中等你
我在风中等你 2020-12-15 17:10

I have a widget tree like this:

SingleChildScrollView
   Column
     Container
       ListView(or GridView)

the problem is that when my wid

6条回答
  •  轮回少年
    2020-12-15 17:54

    You could use your first widget-tree and apply the following changes:

    1. In every ListView and GridView set shrinkWrap: true. This fixes the error message you were getting.
    2. In every ListView and GridView set physics: NeverScrollableScrollPhysics(). This disables the scroll on them and new you can only scroll on the SingleChildScrollView

提交回复
热议问题