getCardDecoration method
dynamic
getCardDecoration(- {dynamic color,
- dynamic borderRadius,
- dynamic shape,
- required double elevation,
- required dynamic offset}
)
Implementation
BoxDecoration getCardDecoration({
Color? color,
BorderRadius? borderRadius,
BoxShape? shape,
required double elevation,
required Offset offset,
}) {
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),
);
}