A RenderViewport expected a child of type RenderSliver but received a child of type RenderConstrainedBox.
RenderObjects expect specific types of children because they coordinate with their children during layout and paint. For example, a RenderSliver cannot be the child of a RenderBox because a RenderSliver does not understand the RenderBox layout protocol.
The RenderViewport that expected a RenderSliver child was created by:
Viewport ← IgnorePointer-[GlobalKey#35d86] ← Semantics ← Listener ← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#98863] ← Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#57f79] ← NotificationListener<ScrollMetricsNotification> ← RepaintBoundary ← CustomPaint ← ⋯
The RenderConstrainedBox that did not match the expected child type was created by:
SizedBox ← Viewport ← IgnorePointer-[GlobalKey#35d86] ← Semantics ← Listener ← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#98863] ← Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#57f79] ← NotificationListener<ScrollMetricsNotification> ← RepaintBoundary ← ⋯
因为在CustomScrollView中都要是slivers类型的组件,如果有其他类型的组件放入其中,则要用
SliverToBoxAdapter 组件 包裹。