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
coloris null, this decoration does not paint a background color. - If
imageis null, this decoration does not paint a background image. - If
borderis null, this decoration does not paint a border. - If
borderRadiusis null, this decoration uses more efficient background painting commands. TheborderRadiusargument must be null ifshapeis BoxShape.circle. - If
boxShadowis null, this decoration does not paint a shadow. - If
gradientis null, this decoration does not paint gradients. - If
backgroundBlendModeis 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.',
);