實(shí)現(xiàn)效果:
可以作為分欄目滑動(dòng)組件使用(水平滑動(dòng)樣式)
代碼如下:
Container(
height: 180.0,
child: ListView(
scrollDirection: Axis.horizontal, // 水平設(shè)置
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,
),
],
),
);