实现效果:
可以作为分栏目滑动组件使用(水平滑动样式)
代码如下:
Container(
height: 180.0,
child: ListView(
scrollDirection: Axis.horizontal, // 水平设置
children: [
Container(
width: 180.0,
height: 180.0,
color: Colors.red,
),
Container(
width: 180.0,
height: 180.0,
color: Colors.blue,
),
Container(
width: 180.0,
height: 180.0,
color: Colors.green,
),
Container(
width: 180.0,
height: 180.0,
color: Colors.yellow,
),
Container(
width: 180.0,
height: 180.0,
color: Colors.deepOrange,
),
Container(
width: 180.0,
height: 180.0,
color: Colors.lightBlue,
),
],
),
);