BoxDecoration constructor
- Color? color,
- DecorationImage? image,
- BoxBorder? border,
- BorderRadiusGeometry? borderRadius,
- List<
BoxShadow> ? boxShadow, - Gradient? gradient,
- BlendMode? backgroundBlendMode,
- BoxShape shape = BoxShape.rectangle,
Creates a box decoration.
- If
color
is null, this decoration does not paint a background color. - If
image
is null, this decoration does not paint a background image. - If
border
is null, this decoration does not paint a border. - If
borderRadius
is null, this decoration uses more efficient background painting commands. TheborderRadius
argument must be null ifshape
is BoxShape.circle. - If
boxShadow
is null, this decoration does not paint a shadow. - If
gradient
is null, this decoration does not paint gradients. - If
backgroundBlendMode
is null, this decoration paints with BlendMode.srcOver
Implementation
const BoxDecoration({
this.color,
this.image,
this.border,
this.borderRadius,
this.boxShadow,
this.gradient,
this.backgroundBlendMode,
this.shape = BoxShape.rectangle,
}) : assert(
backgroundBlendMode == null || color != null || gradient != null,
"backgroundBlendMode applies to BoxDecoration's background color or "
'gradient, but no color or gradient was provided.',
);