基本属性

  1. const Card({
  2. Key key,
  3. this.color, // 背景颜色
  4. this.shadowColor, // 阴影颜色
  5. this.elevation, // 阴影大小
  6. this.shape, // 卡片形状
  7. this.borderOnForeground = true,
  8. this.margin, // 外边距
  9. this.clipBehavior,
  10. this.child,
  11. this.semanticContainer = true,
  12. }) : assert(elevation == null || elevation >= 0.0),
  13. assert(borderOnForeground != null),
  14. super(key: key);

基本用法

  1. Card(
  2. // color: Colors.green[100],
  3. shadowColor: Colors.yellow[700],
  4. elevation: 2.3,
  5. shape: ContinuousRectangleBorder(
  6. side: BorderSide(color: Color(0xffe5e5e5)),
  7. borderRadius: BorderRadius.circular(50)
  8. ),
  9. margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
  10. child: Column(
  11. children: <Widget>[
  12. Row(
  13. children: <Widget>[
  14. Container(
  15. height: 40,
  16. constraints: BoxConstraints(
  17. minWidth: 120
  18. ),
  19. alignment: Alignment.centerRight,
  20. child: Text('会员名称', style: TextStyle(
  21. fontSize: 18
  22. ),),
  23. ),
  24. Text(' : ' , style: TextStyle(
  25. fontSize: 20,
  26. fontWeight: FontWeight.w700
  27. ),),
  28. Container(
  29. height: 40,
  30. alignment: Alignment.centerLeft,
  31. child: Text(data[i]['user_name'], style: TextStyle(
  32. fontSize: 18
  33. ),),
  34. ),
  35. ],
  36. ),
  37. ],
  38. ),
  39. )

image.png