Emi*_*men 3 dart material-design flutter
当我尝试在 SingleScrollChildView 中使用 Card 时,出现以下错误:
\nThe following assertion was thrown during layout:\nA RenderFlex overflowed by 178 pixels on the bottom.\n\nThe relevant error-causing widget was: \n Column file:///C:/Users/emirs/AndroidStudioProjects/view_met/lib/home.dart:197:16\nThe overflowing RenderFlex has an orientation of Axis.vertical.\nThe edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.\n\nConsider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.\nThis is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.\n\nThe specific RenderFlex in question is: RenderFlex#d861f relayoutBoundary=up2 OVERFLOWING\n... needs compositing\n... parentData: offset=Offset(0.0, 0.0) (can use size)\n... constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=820.6)\n... size: Size(411.4, 820.6)\n... direction: vertical\n... mainAxisAlignment: start\n... mainAxisSize: max\n... crossAxisAlignment: center\n... verticalDirection: down\n\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\n
Run Code Online (Sandbox Code Playgroud)\n这是我的代码:
\nThe following assertion was thrown during layout:\nA RenderFlex overflowed by 178 pixels on the bottom.\n\nThe relevant error-causing widget was: \n Column file:///C:/Users/emirs/AndroidStudioProjects/view_met/lib/home.dart:197:16\nThe overflowing RenderFlex has an orientation of Axis.vertical.\nThe edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.\n\nConsider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.\nThis is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.\n\nThe specific RenderFlex in question is: RenderFlex#d861f relayoutBoundary=up2 OVERFLOWING\n... needs compositing\n... parentData: offset=Offset(0.0, 0.0) (can use size)\n... constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=820.6)\n... size: Size(411.4, 820.6)\n... direction: vertical\n... mainAxisAlignment: start\n... mainAxisSize: max\n... crossAxisAlignment: center\n... verticalDirection: down\n\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\xe2\x97\xa2\xe2\x97\xa4\n
Run Code Online (Sandbox Code Playgroud)\n这是builder()
函数:
Padding(\n padding: EdgeInsets.fromLTRB(0, 20, 0, 0),\n child: Column(\n children: <Widget>[\n Text("Random Items You Could Like", style: GoogleFonts.merriweather(fontSize: 18, color: Colors.black)),\n SingleChildScrollView(\n scrollDirection: Axis.vertical,\n child: Column(\n children: <Widget>[\n builder(randint1.toString()),\n builder(randint2.toString()),\n builder(randint3.toString()),\n builder(randint4.toString()),\n builder(randint5.toString()),\n ],\n )\n ),\n ],\n ),\n )\n
Run Code Online (Sandbox Code Playgroud)\n这是结果:
\n\n我也查看了其他问题,但没有一个真正有帮助,而且他们没有我正在寻找的答案。我现在真的不知道该怎么办。我将不胜感激任何类型的帮助。如果需要,我可以提供更多信息。
\nTir*_*tel 11
用 包裹SingleChildScrollView
起来Expanded
。
Column(
children: [
// ...
Expanded(
child: SingleChildScrollView(),
),
],
),
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7110 次 |
最近记录: |