getCardDecoration method
BoxDecoration
getCardDecoration({
- required double elevation,
- required Offset offset,
- Color? color,
- BorderRadius? borderRadius,
- BoxShape? shape,
Implementation
BoxDecoration getCardDecoration({
required double elevation,
required Offset offset,
Color? color,
BorderRadius? borderRadius,
BoxShape? shape,
}) {
final shadows = [
BoxShadow(
color: Colors.black26,
spreadRadius: 0.25 * elevation,
blurRadius: 0.5 * elevation,
offset: offset,
),
];
final border = Border.all(
color: Colors.white24,
width: 2,
);
return BoxDecoration(
borderRadius: borderRadius,
color: color,
shape: shape ?? BoxShape.rectangle,
boxShadow: shadows.ifElseNull(colors.brightness.isLight),
border: border.ifElseNull(colors.brightness.isDark),
);
}