Flutter 如何使卡片像标签一样在颤振中滑动?
我一直在尝试使卡片像标签一样可以在模拟中显示。 我已经添加了代码和mock以供参考 代码: 这是一个只显示一张卡片的容器,该卡片添加在脚手架主体中的一列中 其想法是使用水平可刷卡,让用户看到计划Flutter 如何使卡片像标签一样在颤振中滑动?,flutter,flutter-layout,Flutter,Flutter Layout,我一直在尝试使卡片像标签一样可以在模拟中显示。 我已经添加了代码和mock以供参考 代码: 这是一个只显示一张卡片的容器,该卡片添加在脚手架主体中的一列中 其想法是使用水平可刷卡,让用户看到计划 我是颤振的初学者。您可以使用列表视图,然后将滚动方向设置为水平 只需将所有容器/卡放入列表视图 例如: ListView( scrollDirection: Axis.horizontal, children: <Widget>[
我是颤振的初学者。您可以使用列表视图,然后将滚动方向设置为水平 只需将所有容器/卡放入列表视图 例如:
ListView(
scrollDirection: Axis.horizontal,
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,
),
],
),
ListView(
滚动方向:轴水平,
儿童:[
容器(
宽度:160.0,
颜色:颜色,红色,
),
容器(
宽度:160.0,
颜色:颜色,蓝色,
),
容器(
宽度:160.0,
颜色:颜色。绿色,
),
容器(
宽度:160.0,
颜色:颜色,黄色,
),
容器(
宽度:160.0,
颜色:颜色。橙色,
),
],
),
参考资料
ListView(
scrollDirection: Axis.horizontal,
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,
),
],
),