withShadow method

Widget withShadow({
  1. Color color = Colors.black26,
  2. double blurRadius = 10.0,
  3. double spreadRadius = 0.0,
  4. Offset offset = const Offset(0, 3),
  5. double borderRadius = 0.0,
})

Adds a shadow with the specified color, blur radius, and offset to the widget

Implementation

Widget withShadow({
  Color color = Colors.black26,
  double blurRadius = 10.0,
  double spreadRadius = 0.0,
  Offset offset = const Offset(0, 3),
  double borderRadius = 0.0,
}) => Container(
  decoration: BoxDecoration(
    borderRadius: BorderRadius.circular(borderRadius),
    boxShadow: [
      BoxShadow(
        color: color,
        blurRadius: blurRadius,
        spreadRadius: spreadRadius,
        offset: offset,
      ),
    ],
  ),
  child: this,
);