基本属性
const Card({ Key key, this.color, // 背景颜色 this.shadowColor, // 阴影颜色 this.elevation, // 阴影大小 this.shape, // 卡片形状 this.borderOnForeground = true, this.margin, // 外边距 this.clipBehavior, this.child, this.semanticContainer = true, }) : assert(elevation == null || elevation >= 0.0), assert(borderOnForeground != null), super(key: key);
基本用法
Card( // color: Colors.green[100], shadowColor: Colors.yellow[700], elevation: 2.3, shape: ContinuousRectangleBorder( side: BorderSide(color: Color(0xffe5e5e5)), borderRadius: BorderRadius.circular(50) ), margin: EdgeInsets.fromLTRB(10, 10, 10, 10), child: Column( children: <Widget>[ Row( children: <Widget>[ Container( height: 40, constraints: BoxConstraints( minWidth: 120 ), alignment: Alignment.centerRight, child: Text('会员名称', style: TextStyle( fontSize: 18 ),), ), Text(' : ' , style: TextStyle( fontSize: 20, fontWeight: FontWeight.w700 ),), Container( height: 40, alignment: Alignment.centerLeft, child: Text(data[i]['user_name'], style: TextStyle( fontSize: 18 ),), ), ], ), ], ),)
