Flutter之Card组件
2019-02-19 本文已影响4人
习惯了_就好
/**
* 卡片布局,相当于Android中的CardView
* const Card({
Key key,
this.color,//背景色
this.elevation,//阴影大小
this.shape,//设置边,可以设置圆角
this.margin = const EdgeInsets.all(4.0),
this.clipBehavior = Clip.none,
this.child,
this.semanticContainer = true,
})
*/
body: Container(
width: 100.0,
height: 100.0,
margin: EdgeInsets.all(20.0),
child: Card(
color: Color(0xffff0000),
child: Text("Card组件"),
//设置圆角
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
//设置普通边
// shape: Border.all(
// color: Color(0xff00ff00),
// width: 2.0,
// ),
elevation: 10.0,
margin: EdgeInsets.all(10.0),
),
),