美文网首页flutter
Flutter之Card组件

Flutter之Card组件

作者: 习惯了_就好 | 来源:发表于2019-02-19 13:44 被阅读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),
          ),
        ),

相关文章

网友评论

    本文标题:Flutter之Card组件

    本文链接:https://www.haomeiwen.com/subject/regxyqtx.html