构造函数
const Card({
Key key,
this.color, // 背景色
this.shadowColor, // 阴影颜色
this.elevation, // 景深
this.shape, // 用来设置border-radius
this.borderOnForeground = true, // 外部边框
this.margin, // 和其他组件距离
this.clipBehavior,
this.child, // 内部子项
this.semanticContainer = true,
})
Demo

截屏2020-05-12 下午9.47.41.png
Card(
color: Colors.grey,
shadowColor: Colors.green[200],
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(14.0))),
margin: EdgeInsets.all(30),
elevation: 20,
borderOnForeground: false,
clipBehavior: Clip.antiAlias,
child: Container(child: Text("Card Title"),)
)
网友评论