我的页面代码是这样的。我需要滚动AppBar下面的部分。
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(... ),
body: new Stack(
children: <Widget>[
new Container(
decoration: BoxDecoration(
image: DecorationImage(...),
new Column(children: [
new Container(...),
new Container(...... ),
new Padding(
child: SizedBox(
child: RaisedButton(..),
),
new Divider(),
new Column(
children: <Widget>[
new Container(
child: new Row(
children: <Widget>[
new Expanded(
child: new Text( ),
),
new IconButton(
icon: IconButton(..),
onPressed: () {
_changed(true, "type");
},
),
],
),
),
visibilityPropertyType
? new Container(
margin: EdgeInsets.all(24.0),
child: new Column(
children: <Widget>[
new Row(
children: <Widget>[
new Expanded(... ),
new RaisedButton(..)
],
),
new Padding(
padding: const EdgeInsets.only(top: 10.0),
child: new Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: <Widget>[
new Column(
children: <Widget>[
new Row(
children: <Widget>[.. ]),
new Row(
children: <Widget>[]),
new Row(
children: <Widget>[]),
new Row(
children: <Widget>[],
),
new Column(
children: <Widget>[
new Row(
children: <Widget>[],
),
],
),
],
),
),
],
))
: new Container(),
],
),
new Divider(
color: Colors.white,
)
])
],
),
);
}
我需要让页面的部分内容可以滚动,你能帮我实现这个功能吗?如果有现成的自定义滚动方法,麻烦告诉我一下。我已经尝试了 Scrollable 和 SingleChildScrollView,但都不能满足我的需求。当我使用 SinglechildScrollView 时,会出现 BoxConstraints 强制无限高度的错误。如果我移除 LayoutBuilder,就会出现 RenderFlex 在底部溢出 22 个像素的错误。
RenderFlex children have non-zero flex but incoming height constraints are unbounded.
,意思是我的代码出现了问题,可能是因为我使用了具有非零flex属性的组件,但是没有给它们设置高度限制。 - TwometerSpacer()
也会导致RenderFlex children have non-zero flex but incoming height constraints are unbounded.
问题。 - kris