有时,您可能想要创建一个水平滚动(而不是垂直滚动)的列表。 ListView
: https://docs.flutter.io/flutter/widgets/ListView-class.html
本身就支持水平list。
在创建ListView时,设置scrollDirection
为水平方向以覆盖默认的垂直方向。
new ListView(
// This next line does the trick.
scrollDirection: Axis.horizontal,
children: <Widget>[
new Container(
...