decoration.dart 948 B

1234567891011121314151617181920212223242526
  1. import 'package:flutter/material.dart';
  2. Decoration card({circular = 10.0}) => BoxDecoration(
  3. color: Colors.white, // 底色
  4. borderRadius:
  5. new BorderRadius.all(Radius.circular(circular)), // 也可控件一边圆角大小
  6. boxShadow: [
  7. BoxShadow(
  8. offset: Offset(0.0, 0),
  9. blurRadius: 7,
  10. spreadRadius: 0,
  11. color: Color.fromRGBO(0, 0, 0, 0.07))
  12. ]);
  13. Decoration circular({circular = 10.0}) => BoxDecoration(
  14. borderRadius: BorderRadius.circular(circular), color: Colors.white);
  15. Decoration shadowTop() => BoxDecoration(color: Colors.white, // 底色
  16. boxShadow: [
  17. BoxShadow(
  18. color: Colors.black.withOpacity(0.04),
  19. offset: Offset(0.0, -3.0), //阴影xy轴偏移量
  20. blurRadius: 5.0, //阴影模糊程度
  21. spreadRadius: .0 //阴影扩散程度
  22. )
  23. ]);