java写的卡片式布局例子_10、Flutter常用布局-Card卡片式布局

一、卡片式布局Card的使用

卡片式布局类似ViewList,但是列表会以物理卡片的形态进行展示。卡片式布局默认是撑满整个外部容器的,如果想设置卡片的宽高,需要在外部容器就进行制定。

/**

* 卡片式布局

*/

class CardWidget extends StatelessWidget {

@override

Widget build(BuildContext context) {

return Card(

child: Column(

children: [

ListTile(

leading: Icon(Icons.account_box, color: Colors.lightBlue),

title:

Text("江苏省徐州市沛县", style: TextStyle(fontWeight: FontWeight.w500)),

subtitle: Text("天奇:187****3450"),

),

Divider(),

ListTile(

leading: Icon(Icons.account_box, color: Colors.lightBlue),

title: Text("江苏省南京市江宁区",

style: TextStyle(fontWeight: FontWeight.w500)),

subtitle: Text("春运:153****5502"),

),

Divider(),

ListTile(

leading: Icon(Icons.account_box, color: Colors.lightBlue),

title: Text("浙江省杭州市余杭区",

style: TextStyle(fontWeight: FontWeight.w500)),

subtitle: Text("传鹏:166****1218")),

Divider()

],

),

);

}

}

实现效果:

8f5811c6efa4eb2e1743d5e42ebe9e20.png

Divider()是分割线。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值