kdecorationRadius function

BoxDecoration kdecorationRadius(
  1. Color color,
  2. int radius, {
  3. int borderWidth = 0,
  4. Color? borderColor,
  5. Color? shadowColor,
  6. double dx = 0,
  7. double dy = 0,
  8. double blurRadius = 0,
  9. double spreadRadius = 0,
})

圆角边框 color 颜色 radius 圆角 borderWidth 边框宽度 borderColor 边框颜色 shadowColor 阴影颜色 dx 阴影x轴偏移量 dy 阴影y轴偏移量 blurRadius 阴影模糊程度 spreadRadius 阴影扩散程度

Implementation

BoxDecoration kdecorationRadius(
  Color color,
  int radius, {
  int borderWidth = 0,
  Color? borderColor,
  Color? shadowColor,
  double dx = 0,
  double dy = 0,
  double blurRadius = 0,
  double spreadRadius = 0,
}) {
  return BoxDecoration(
    borderRadius: BorderRadius.all(Radius.circular(radius.r)),
    color: color,
    border: Border.all(width: borderWidth.w, color: borderColor ?? color),
    boxShadow: [
      BoxShadow(
        color: shadowColor ?? Colors.transparent,
        offset: Offset(dx, dy), //阴影xy轴偏移量
        blurRadius: blurRadius, //阴影模糊程度
        spreadRadius: spreadRadius, //阴影扩散程度
      ),
    ],
  );
}