decorated method

Widget decorated({
  1. Key? key,
  2. Color? color,
  3. DecorationImage? image,
  4. BoxBorder? border,
  5. BorderRadius? borderRadius,
  6. List<BoxShadow>? boxShadow,
  7. Gradient? gradient,
  8. BlendMode? backgroundBlendMode,
  9. BoxShape shape = BoxShape.rectangle,
  10. DecorationPosition position = DecorationPosition.background,
  11. bool animate = false,
})

Implementation

Widget decorated({
  Key? key,
  Color? color,
  DecorationImage? image,
  BoxBorder? border,
  BorderRadius? borderRadius,
  List<BoxShadow>? boxShadow,
  Gradient? gradient,
  BlendMode? backgroundBlendMode,
  BoxShape shape = BoxShape.rectangle,
  DecorationPosition position = DecorationPosition.background,
  bool animate = false,
}) {
  BoxDecoration decoration = BoxDecoration(
    color: color,
    image: image,
    border: border,
    borderRadius: borderRadius,
    boxShadow: boxShadow,
    gradient: gradient,
    backgroundBlendMode: backgroundBlendMode,
    shape: shape,
  );
  return animate
      ? _StyledAnimatedBuilder(
          key: key,
          builder: (animation) {
            return _AnimatedDecorationBox(
              child: this,
              decoration: decoration,
              position: position,
              duration: animation.duration,
              curve: animation.curve,
            );
          },
        )
      : DecoratedBox(
          key: key,
          child: this,
          decoration: decoration,
          position: position,
        );
}