card method

Widget card({
  1. Key? key,
  2. double? radius,
  3. Color? color,
  4. Color? shadowColor,
  5. double? blurRadius,
})

卡片

Implementation

Widget card({
  Key? key,
  double? radius,
  Color? color,
  Color? shadowColor,
  double? blurRadius,
}) =>
    Container(
      decoration: BoxDecoration(
        color: color ?? Colors.white,
        borderRadius: BorderRadius.all(
          Radius.circular(radius ?? 5),
        ),
        boxShadow: shadowColor != null
            ? [
                BoxShadow(
                  // x偏移量 | y偏移量
                  offset: const Offset(0, 3),
                  color: shadowColor,
                  // 阴影模糊半径
                  blurRadius: blurRadius ?? 8,
                  // 阴影扩散半径
                  spreadRadius: 0,
                  blurStyle: BlurStyle.normal,
                ),
              ]
            : null,
      ),
      child: this,
    );