withColoredShadow method

Widget withColoredShadow({
  1. required Color color,
  2. double blurRadius = 10.0,
  3. double spreadRadius = 0.0,
  4. Offset offset = const Offset(0, 3),
})

Adds a colored shadow to the widget

Implementation

Widget withColoredShadow({
  required Color color,
  double blurRadius = 10.0,
  double spreadRadius = 0.0,
  Offset offset = const Offset(0, 3),
}) => Container(
  decoration: BoxDecoration(
    boxShadow: [
      BoxShadow(
        color: color.withOpacity(0.5),
        blurRadius: blurRadius,
        spreadRadius: spreadRadius,
        offset: offset,
      ),
    ],
  ),
  child: this,
);