card method
卡片
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,
);