https://api.flutter.dev/flutter/material/Card-class.html
一个 Material Design 卡片。拥有一个圆角和阴影。定义如下:
Card({
Key key,
this.color,
this.shadowColor,
this.elevation,
this.shape,
this.borderOnForeground = true,
this.margin,
this.clipBehavior,
this.child,
this.semanticContainer = true,
})
示例1:
ListView(
children: [
Card(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
title: Text('张三', style: TextStyle(fontSize: 28)),
subtitle: Text('高级软件工程师'),
),
ListTile(
title: Text('电话:13432143434'),
),
ListTile(
title: Text('地址:******'),
),
],
),
),
],
);
示例2:
ListView(
children: [
Card(
margin: EdgeInsets.all(10),
child: Column(
children: [
AspectRatio(
aspectRatio: 16 / 9,
child: Image.network(
'https://img.pic88.com/preview/2020/09/02/1599056029788949.jpg',
fit: BoxFit.cover,
),
),
ListTile(
leading: CircleAvatar(
backgroundImage: NetworkImage(
'https://img.pic88.com/preview/2020/09/02/1599056029788949.jpg',
),
),
title: Text('张三'),
subtitle: Text('高级软件工程师'),
),
],
),
),
],
);