decorated method
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,
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,
);
}