Are*_*s91 2 dart flutter flutter-layout singlechildscrollview
我正在尝试归档一种类似于图像的布局,该布局具有顶部固定区域(红色)和一个可滚动区域(黄色),顶部有一些文本字段(文本 1、文本 2),并且在顶部有一个终端元素可滚动区域的底部(* 底部文本)。我尝试使用下面的代码执行此操作,但出现一些错误,如下所示:
\n\n使用此代码
\nWidget _data(BuildContext context) {\n return new Column(children: <Widget>[\n Container(\n color: Colors.red,\n height: 200\n ),\n Expanded(\n child: Container(\n color: Colors.yellow,\n child: SingleChildScrollView(\n child: Column(\n children: [\n new Text("Text 1"),\n new Text("Text 2"),\n new Expanded(\n child: new Align(\n alignment: Alignment.bottomCenter,\n child: new Row(\n mainAxisAlignment: MainAxisAlignment.center,\n children: <Widget>[\n new Icon(Icons.star),\n new Text("Bottom Text")\n ],\n )))\n ],\n ),\n ),\n ),\n )\n\n ]);\n }\n
Run Code Online (Sandbox Code Playgroud)\n和错误:
\n \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90 Exception caught by rendering library \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nThe following assertion was thrown during performLayout():\nRenderFlex children have non-zero flex but incoming height constraints are unbounded.\n\nWhen 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.\nThese two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child cannot simultaneously expand to fit its parent.\n\nConsider 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.\n\nIf this message did not help you determine the problem, consider using debugDumpRenderTree():\n https://flutter.dev/debugging/#rendering-layer\n http://api.flutter.dev/flutter/rendering/debugDumpRenderTree.html\nThe affected RenderFlex is: RenderFlex#f257e relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n parentData: <none> (can use size)\n constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)\n size: MISSING\n direction: vertical\n mainAxisAlignment: start\n mainAxisSize: max\n crossAxisAlignment: center\n verticalDirection: down\n... child 1: RenderParagraph#3042c relayoutBoundary=up14 NEEDS-PAINT\n... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)\n... constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)\n... size: Size(38.0, 16.0)\n... textAlign: start\n... textDirection: ltr\n... softWrap: wrapping at box width\n... overflow: clip\n... locale: en_US\n... maxLines: unlimited\n... text: TextSpan\n... debugLabel: (englishLike body1 2014).merge(blackMountainView bodyText2)\n... inherit: false\n... color: Color(0xdd000000)\n... family: Roboto\n... size: 14.0\n... weight: 400\n... baseline: alphabetic\n... decoration: TextDecoration.none\n... "Text 1"\n... child 2: RenderParagraph#9fc6a relayoutBoundary=up14 NEEDS-PAINT\n... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)\n... constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)\n... size: Size(38.0, 16.0)\n... textAlign: start\n... textDirection: ltr\n... softWrap: wrapping at box width\n... overflow: clip\n... locale: en_US\n... maxLines: unlimited\n... text: TextSpan\n... debugLabel: (englishLike body1 2014).merge(blackMountainView bodyText2)\n... inherit: false\n... color: Color(0xdd000000)\n... family: Roboto\n... size: 14.0\n... weight: 400\n... baseline: alphabetic\n... decoration: TextDecoration.none\n... "Text 2"\n... child 3: RenderPositionedBox#5d50a NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight\n... constraints: MISSING\n... size: MISSING\n... alignment: bottomCenter\n... textDirection: ltr\n... widthFactor: expand\n... heightFactor: expand\n... child: RenderFlex#0cef5 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: offset=Offset(0.0, 0.0)\n... constraints: MISSING\n... size: MISSING\n... direction: horizontal\n... mainAxisAlignment: center\n... mainAxisSize: max\n... crossAxisAlignment: center\n... textDirection: ltr\n... verticalDirection: down\n... child 1: RenderSemanticsAnnotations#e51a3 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null\n... constraints: MISSING\n... size: MISSING\n... child: RenderExcludeSemantics#fe319 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: <none>\n... constraints: MISSING\n... size: MISSING\n... excluding: true\n... child 2: RenderParagraph#f3d9e NEEDS-LAYOUT NEEDS-PAINT\n... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null\n... constraints: MISSING\n... size: MISSING\n... textAlign: start\n... textDirection: ltr\n... softWrap: wrapping at box width\n... overflow: clip\n... locale: en_US\n... maxLines: unlimited\n... text: TextSpan\n... debugLabel: (englishLike body1 2014).merge(blackMountainView bodyText2)\n... inherit: false\n... color: Color(0xdd000000)\n... family: Roboto\n... size: 14.0\n... weight: 400\n... baseline: alphabetic\n... decoration: TextDecoration.none\n... "Bottom Text"\nThe creator information is set to: Column \xe2\x86\x90 _SingleChildViewport \xe2\x86\x90 IgnorePointer-[GlobalKey#9947f] \xe2\x86\x90 Semantics \xe2\x86\x90 _PointerListener \xe2\x86\x90 Listener \xe2\x86\x90 _GestureSemantics \xe2\x86\x90 RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#684ef] \xe2\x86\x90 _PointerListener \xe2\x86\x90 Listener \xe2\x86\x90 _ScrollableScope \xe2\x86\x90 _ScrollSemantics-[GlobalKey#cace4] \xe2\x86\x90 \xe2\x8b\xaf\nThe nearest ancestor providing an unbounded width constraint is: _RenderSingleChildViewport#f3d08 relayoutBoundary=up12 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... needs compositing\n... parentData: <none> (can use size)\n... constraints: BoxConstraints(0.0<=w<=360.0, h=404.0)\n... size: MISSING\n\nSee also: https://flutter.dev/layout/\n\nIf none of the above helps enough to fix this problem, please don\'t hesitate to file a bug:\n https://github.com/flutter/flutter/issues/new?template=BUG.md\nThe relevant error-causing widget was: \n Column file:///F://FlutterApp/my_login/lib/widgets/Login.dart:50:16\nWhen the exception was thrown, this was the stack: \n#0 RenderFlex.performLayout.<anonymous closure> (package:flutter/src/rendering/flex.dart:712:11)\n#1 RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:739:10)\n#2 RenderObject.layout (package:flutter/src/rendering/object.dart:1769:7)\n#3 _RenderSingleChildViewport.performLayout (package:flutter/src/widgets/single_child_scroll_view.dart:544:13)\n#4 RenderObject.layout (package:flutter/src/rendering/object.dart:1769:7)\n...\nThe following RenderObject was being processed when the exception was fired: RenderFlex#f257e relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: <none> (can use size)\n... constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)\n... size: MISSING\n... direction: vertical\n... mainAxisAlignment: start\n... mainAxisSize: max\n... crossAxisAlignment: center\n... verticalDirection: down\nRenderObject: RenderFlex#f257e relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n parentData: <none> (can use size)\n constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)\n size: MISSING\n direction: vertical\n mainAxisAlignment: start\n mainAxisSize: max\n crossAxisAlignment: center\n verticalDirection: down\n... child 1: RenderParagraph#3042c relayoutBoundary=up14 NEEDS-PAINT\n... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)\n... constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)\n... size: Size(38.0, 16.0)\n... textAlign: start\n... textDirection: ltr\n... softWrap: wrapping at box width\n... overflow: clip\n... locale: en_US\n... maxLines: unlimited\n... text: TextSpan\n... debugLabel: (englishLike body1 2014).merge(blackMountainView bodyText2)\n... inherit: false\n... color: Color(0xdd000000)\n... family: Roboto\n... size: 14.0\n... weight: 400\n... baseline: alphabetic\n... decoration: TextDecoration.none\n... "Text 1"\n... child 2: RenderParagraph#9fc6a relayoutBoundary=up14 NEEDS-PAINT\n... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size)\n... constraints: BoxConstraints(0.0<=w<=360.0, 0.0<=h<=Infinity)\n... size: Size(38.0, 16.0)\n... textAlign: start\n... textDirection: ltr\n... softWrap: wrapping at box width\n... overflow: clip\n... locale: en_US\n... maxLines: unlimited\n... text: TextSpan\n... debugLabel: (englishLike body1 2014).merge(blackMountainView bodyText2)\n... inherit: false\n... color: Color(0xdd000000)\n... family: Roboto\n... size: 14.0\n... weight: 400\n... baseline: alphabetic\n... decoration: TextDecoration.none\n... "Text 2"\n... child 3: RenderPositionedBox#5d50a NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: offset=Offset(0.0, 0.0); flex=1; fit=FlexFit.tight\n... constraints: MISSING\n... size: MISSING\n... alignment: bottomCenter\n... textDirection: ltr\n... widthFactor: expand\n... heightFactor: expand\n... child: RenderFlex#0cef5 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: offset=Offset(0.0, 0.0)\n... constraints: MISSING\n... size: MISSING\n... direction: horizontal\n... mainAxisAlignment: center\n... mainAxisSize: max\n... crossAxisAlignment: center\n... textDirection: ltr\n... verticalDirection: down\n... child 1: RenderSemanticsAnnotations#e51a3 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null\n... constraints: MISSING\n... size: MISSING\n... child: RenderExcludeSemantics#fe319 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n... parentData: <none>\n... constraints: MISSING\n... size: MISSING\n... excluding: true\n... child 2: RenderParagraph#f3d9e NEEDS-LAYOUT NEEDS-PAINT\n... parentData: offset=Offset(0.0, 0.0); flex=null; fit=null\n... constraints: MISSING\n... size: MISSING\n... textAlign: start\n... textDirection: ltr\n... softWrap: wrapping at box width\n... overflow: clip\n... locale: en_US\n... maxLines: unlimited\n... text: TextSpan\n... debugLabel: (englishLike body1 2014).merge(blackMountainView bodyText2)\n... inherit: false\n... color: Color(0xdd000000)\n... family: Roboto\n... size: 14.0\n... weight: 400\n... baseline: alphabetic\n... decoration: TextDecoration.none\n... "Bottom Text"\n\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n\nAnother exception was thrown: RenderBox was not laid out: RenderIgnorePointer#057ad relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n\nAnother exception was thrown: RenderBox was not laid out: RenderSemanticsAnnotations#cc735 relayoutBoundary=up10 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n\n\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90 Exception caught by rendering library \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nRenderBox was not laid out: RenderFlex#f257e relayoutBoundary=up13 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n\'package:flutter/src/rendering/box.dart\':\nFailed assertion: line 1702 pos 12: \'hasSize\'\nThe relevant error-causing widget was: \n SingleChildScrollView file:///F://FlutterApp/my_login/lib/widgets/Login.dart:49:15\n\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n\nAnother exception was thrown: RenderBox was not laid out: RenderPointerListener#630c8 relayoutBoundary=up9 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n\nAnother exception was thrown: RenderBox was not laid out: RenderSemanticsGestureHandler#485d8 relayoutBoundary=up8 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n\n\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90 Exception caught by rendering library \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nRenderBox was not laid out: _RenderSingleChildViewport#f3d08 relayoutBoundary=up12 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n\'package:flutter/src/rendering/box.dart\':\nFailed assertion: line 1702 pos 12: \'hasSize\'\nThe relevant error-causing widget was: \n SingleChildScrollView file:///F://FlutterApp/my_login/lib/widgets/Login.dart:49:15\n\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\n\nAnother exception was thrown: RenderBox was not laid out: RenderPointerListener#516b1 relayoutBoundary=up7 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE\n\n\xe2\x95\x90\xe2\
voi*_*oid 11
这有效。一探究竟。
Column(
children: <Widget>[
Container(color: Colors.red, height: 200),
Expanded(
child: Container(
color: Colors.yellow,
child: LayoutBuilder(
builder: (context, constraint) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints:
BoxConstraints(minHeight: constraint.maxHeight),
child: IntrinsicHeight(
child: Column(
children: [
Text("Text 1"),
Text("Text 2"),
// middle widget goes here
Expanded(
child: Container(),
),
Align(
alignment: Alignment.bottomCenter,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.star),
Text("Bottom Text")
],
),
),
],
),
),
),
);
},
),
),
)
],
)
Run Code Online (Sandbox Code Playgroud)
结果:
归档时间: |
|
查看次数: |
10004 次 |
最近记录: |