boxShadow method

Widget boxShadow({
  1. Key? key,
  2. Color color = const Color(0xFF000000),
  3. Offset offset = Offset.zero,
  4. double blurRadius = 0.0,
  5. double spreadRadius = 0.0,
  6. bool animate = false,
})

Implementation

Widget boxShadow({
  Key? key,
  Color color = const Color(0xFF000000),
  Offset offset = Offset.zero,
  double blurRadius = 0.0,
  double spreadRadius = 0.0,
  bool animate = false,
}) {
  BoxDecoration decoration = BoxDecoration(
    boxShadow: [
      BoxShadow(
        color: color,
        blurRadius: blurRadius,
        spreadRadius: spreadRadius,
        offset: offset,
      ),
    ],
  );
  return animate
      ? _StyledAnimatedBuilder(
          key: key,
          builder: (animation) {
            return _AnimatedDecorationBox(
              child: this,
              decoration: decoration,
              duration: animation.duration,
              curve: animation.curve,
            );
          },
        )
      : DecoratedBox(
          key: key,
          child: this,
          decoration: decoration,
        );
}