decoration.dart 779 B

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