我如何制作像这样的水平滚动小部件,其中包含图像?
[![在此处输入图片描述] [1]] [1]
答案 0 :(得分:0)
ListView(
scrollDirection: Axis.horizontal, // <-- Like so
children: <Widget>[
Container(
width: 160.0,
color: Colors.red,
),
Container(
width: 160.0,
color: Colors.blue,
),
Container(
width: 160.0,
color: Colors.green,
),
Container(
width: 160.0,
color: Colors.yellow,
),
Container(
width: 160.0,
color: Colors.orange,
),
],
)
代码基于flutter的docs