Flutter中常用的组件-Card

 //Card:是一个小部件,用于创建一个带有四个圆角的矩形区域,并在其边缘上有阴影效果。Card包含相册、地理位置、联系方式等信息。
          new Card(
        //margin 属性用于在 Card 周围创建一个空白空间。
        margin: EdgeInsets.all(20),
        //color 属性用于设置 Card 的背景颜色。如果此属性为 null,则使用 ThemeData.cardTheme 的 CardTheme.color。如果 CardTheme.color 也为 null,则使用 ThemeData.cardColor。
        color: Colors.teal,
        //shadowColor 是用于绘制卡片阴影的颜色。
        shadowColor: Colors.amber,
        //Elevation 是 Card 沿 Z 轴的坐标,它影响 Card 阴影的大小。如果此属性为 null,则使用 ThemeData.cardTheme 的 CardTheme.elevation。如果 CardTheme.elevation 也为 null,则默认值为 1.0。
        elevation: 10,
        //shape 属性用于定义 Card 的边框形状。如果此属性为 null,则使用 ThemeData.cardTheme 的 CardTheme.shape。如果 CardTheme.shape 也为 null,则该形状将是圆角半径RoundedRectangleBorder 为 4.0 。
        shape: new RoundedRectangleBorder(
            side: new BorderSide(width: 2, color: Colors.tealAccent),
            borderRadius: new BorderRadius.all(new Radius.circular(10))),
        //如果 borderOnForeground 为 true,则形状的边框将绘制在孩子的前面。反之亦然,将在子元素身后绘制边框。
        borderOnForeground: false,

        // clipBehavior: Clip.antiAliasWithSaveLayer,
        //如果 semanticContainer 为true,则表示Card 及其所有子部件具有相同的语义。相反,它们的语义是不同的。
        semanticContainer: false,
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.start,
          mainAxisSize: MainAxisSize.min,
          children: [
            new ListTile(
              leading: new Icon(
                Icons.light,
                size: 40,
                color: Colors.amber,
              ),
              title: new Text(
                "没见过萨科",
                style: new TextStyle(color: Colors.white),
              ),
              subtitle: new Text("玛纳斯卡巴拉DSL"),
            )
          ],
        ),
      ),

猜你喜欢

转载自blog.csdn.net/guliang28/article/details/128831753