Flutter RenderFlex子项具有非零的弹性,但传入的高度约束是无限的

Flutter RenderFlex子项具有非零的弹性,但传入的高度约束是无限的,flutter,Flutter,当小部件长度大于屏幕长度时,我会出现以下错误。我确信我在这里遗漏了一些基本的东西 代码如下: body: Column( mainAxisSize: MainAxisSize.min, children: <Widget>[ Flexible( child: SingleChildScrollView( child: Column(

当小部件长度大于屏幕长度时,我会出现以下错误。我确信我在这里遗漏了一些基本的东西

代码如下:

        body: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Flexible(
              child: SingleChildScrollView(
                child: Column(
                  mainAxisSize: MainAxisSize.min,
                  children: <Widget>[
                    CarouselImages(widget.store.pictures),
                    StoreDetails(
                      store: widget.store,
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),


我在这里遗漏了什么?

我认为您需要将单子滚动视图包装在扩展的Widget中。如果您要将滚动扩展到整个屏幕,然后删除外部级别列,您不需要它。@克里斯错误仍然是一样的。@Kashifa我有一些其他小部件可以显示在
单子滚动视图上
═══════ Exception caught by rendering library ═════════════════════════════════
The following assertion was thrown during performLayout():
RenderFlex children have non-zero flex but incoming height constraints are unbounded.

When a column is in a parent that does not provide a finite height constraint, for example if it is in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining space in the vertical direction.
These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child cannot simultaneously expand to fit its parent.

Consider setting mainAxisSize to MainAxisSize.min and using FlexFit.loose fits for the flexible children (using Flexible rather than Expanded). This will allow the flexible children to size themselves to less than the infinite remaining space they would otherwise be forced to take, and then will cause the RenderFlex to shrink-wrap the children rather than expanding to fit the maximum constraints provided by the parent.

If this message did not help you determine the problem, consider using debugDumpRenderTree():
  https://flutter.dev/debugging/#rendering-layer
  http://api.flutter.dev/flutter/rendering/debugDumpRenderTree.html
The affected RenderFlex is: RenderFlex#c1cb1 relayoutBoundary=up12 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE