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: ColorValue | None = None

The color to fill in the background of the box.

blend_modeclass-attributeinstance-attribute

blend_mode: BlendMode | None = None

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

borderclass-attributeinstance-attribute

border: Border | None = None

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

border_radiusclass-attributeinstance-attribute

border_radius: BorderRadiusValue | None = None

The border radius of the box.

gradientclass-attributeinstance-attribute

gradient: Gradient | None = None

A gradient to use when filling the box.

imageclass-attributeinstance-attribute

image: DecorationImage | None = None

An image to paint above the background bgcolor or gradient.

shadowsclass-attributeinstance-attribute

shadows: BoxShadowValue | None = 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: ColorValue | None = None,
    image: DecorationImage | None = None,
    border: Border | None = None,
    border_radius: BorderRadiusValue | None = None,
    shadows: BoxShadowValue | None = None,
    gradient: Gradient | None = None,
    shape: BoxShape | None = None,
    blend_mode: BlendMode | None = None,
)

Returns a new BoxDecoration with selected fields overridden.