Skip to content

DecorationImage

An image for a box decoration.

Properties

Methods

  • copy

    Returns a copy of this object with the specified properties overridden.

Properties#

alignment class-attribute instance-attribute #

alignment: Alignment = field(default_factory=lambda: CENTER)

The alignment of the image within its bounds.

anti_alias class-attribute instance-attribute #

anti_alias: bool = False

Whether to paint the image in anti-aliased quality.

color_filter class-attribute instance-attribute #

color_filter: Optional[ColorFilter] = None

A color filter to apply to the image before painting it.

filter_quality class-attribute instance-attribute #

filter_quality: FilterQuality = MEDIUM

The quality of the image filter.

fit class-attribute instance-attribute #

fit: Optional[BoxFit] = None

How the image should be inscribed into the box.

invert_colors class-attribute instance-attribute #

invert_colors: bool = False

Whether to invert the colors of the image while drawing.

match_text_direction class-attribute instance-attribute #

match_text_direction: bool = False

Whether to paint the image in the direction of the TextDirection.

opacity class-attribute instance-attribute #

opacity: Number = 1.0

The opacity of the image.

repeat class-attribute instance-attribute #

How the image should be repeated to fill the box.

scale class-attribute instance-attribute #

scale: Number = 1.0

The scale(image pixels to be shown per logical pixels) to apply to the image.

src class-attribute instance-attribute #

src: Optional[Union[str, bytes]] = None

The image source to paint.

Accepts URLs, asset paths, base64 strings (with or without data: prefixes), or raw bytes.

Methods#

copy #

copy(
    *,
    src: Optional[Union[str, bytes]] = None,
    color_filter: Optional[ColorFilter] = None,
    fit: Optional[BoxFit] = None,
    alignment: Optional[Alignment] = None,
    repeat: Optional[ImageRepeat] = None,
    match_text_direction: Optional[bool] = None,
    scale: Optional[Number] = None,
    opacity: Optional[Number] = None,
    filter_quality: Optional[FilterQuality] = None,
    invert_colors: Optional[bool] = None,
    anti_alias: Optional[bool] = None,
) -> DecorationImage

Returns a copy of this object with the specified properties overridden.