一、卡片式布局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()
],
),
);
}
}
实现效果:
Divider()是分割线。