我刚开始学习Flutter,遇到了一个布局问题,这里提供一个视觉示例:
我已经尝试过以下方法:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Welcome to Flutter',
home: new Scaffold(
appBar: new AppBar(
title: new Text('App'),
),
body: new Column(
children: <Widget>[
new Text('LISTA',
style: new TextStyle(
fontSize: 15.2,
fontWeight: FontWeight.bold,
)
),
new Container(
height: 200.0,
child: new ListView(
children: <Widget>[
new RaisedButton(
onPressed: null,
child: new Text("text button"),
),
new Padding(padding: new EdgeInsets.all(5.00)),
new RaisedButton(
onPressed: null,
child: new Text("text button 2"),
)
],
),
)
]
)
),
);
}
}
但是对于容器,它需要一个高度,并且我希望它占据整个屏幕的剩余空间。
Expanded
小部件。 - Rémi Rousselet