SingleChildScrollView 和 StaggeredGridView嵌套使用和报错
来源:16-5 实现旅拍瀑布流布局-2

qq_大风吹_0
2019-09-19
flutter: The following assertion was thrown during performResize():
flutter: Vertical viewport was given unbounded height.
flutter: Viewports expand in the scrolling direction to fill their container.In this case, a vertical
flutter: viewport was given an unlimited amount of vertical space in which to expand. This situation
flutter: typically happens when a scrollable widget is nested inside another scrollable widget.
flutter: If this widget is always nested in a scrollable widget there is no need to use a viewport because
flutter: there will always be enough vertical space for the children. In this case, consider using a Column
flutter: instead. Otherwise, consider using the “shrinkWrap” property (or a ShrinkWrappingViewport) to size
flutter: the height of the viewport to the sum of the heights of its children.
如果在StaggeredGridView父级Container给定一个固定的高度能解决这个问题,但StaggeredGridView模块高度不确定改怎么解决呢~
要实现如下图中的效果 老师有没有更好的解决方案
1回答
-
CrazyCodeBoy
2019-09-23
对于两个都是垂直滚动的组件需要设置下其中一个的高度
00
相似问题