Skip to main content

BoxDecoration

BoxDecoration provides a description of how to paint a box. The box has a border, a body, and may cast a shadow.

Properties

Methods

  • copy - Returns a new BoxDecoration with selected fields overridden.

Properties

bgcolorclass-attributeinstance-attribute

bgcolor: Optional[ColorValue] = None

The color to fill in the background of the box.

blend_modeclass-attributeinstance-attribute

blend_mode: Optional[BlendMode] = None

The blend mode to apply to the background bgcolor or gradient.

borderclass-attributeinstance-attribute

border: Optional[Border] = None

A border to draw above the background bgcolor, gradient, and image.

border_radiusclass-attributeinstance-attribute

border_radius: Optional[BorderRadiusValue] = None

The border radius of the box.

gradientclass-attributeinstance-attribute

gradient: Optional[Gradient] = None

A gradient to use when filling the box.

imageclass-attributeinstance-attribute

image: Optional[DecorationImage] = None

An image to paint above the background bgcolor or gradient.

shadowsclass-attributeinstance-attribute

shadows: Optional[BoxShadowValue] = None

A list of shadows cast by the box.

shapeclass-attributeinstance-attribute

The shape to fill the bgcolor, gradient, and image into and to cast as the shadows.

Methods

copy

copy(bgcolor: Optional[ColorValue] = None, image: Optional[DecorationImage] = None, border: Optional[Border] = None, border_radius: Optional[BorderRadiusValue] = None, shadows: Optional[BoxShadowValue] = None, gradient: Optional[Gradient] = None, shape: Optional[BoxShape] = None, blend_mode: Optional[BlendMode] = None)

Returns a new BoxDecoration with selected fields overridden.