Skip to content

DecorationImage

DecorationImage #

An image for a box decoration.

alignment #

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

The alignment of the image within its bounds.

anti_alias #

anti_alias: bool = False

Whether to paint the image in anti-aliased quality.

color_filter #

color_filter: ColorFilter | None = None

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

filter_quality #

filter_quality: FilterQuality = MEDIUM

The quality of the image filter.

fit #

fit: BoxFit | None = None

How the image should be inscribed into the box.

invert_colors #

invert_colors: bool = False

Whether to invert the colors of the image while drawing.

match_text_direction #

match_text_direction: bool = False

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

opacity #

opacity: Number = 1.0

The opacity of the image.

repeat #

How the image should be repeated to fill the box.

scale #

scale: Number = 1.0

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

src #

src: str | None = None

The image to paint.

src_base64 #

src_base64: str | None = None

The base64-encoded image to paint.

src_bytes #

src_bytes: bytes | None = None

TBD

copy_with #

copy_with(
    *,
    src: str | None = None,
    src_base64: str | None = None,
    src_bytes: bytes | None = None,
    color_filter: ColorFilter | None = None,
    fit: BoxFit | None = None,
    alignment: Alignment | None = None,
    repeat: ImageRepeat | None = None,
    match_text_direction: bool | None = None,
    scale: Number | None = None,
    opacity: Number | None = None,
    filter_quality: FilterQuality | None = None,
    invert_colors: bool | None = None,
    anti_alias: bool | None = None,
) -> DecorationImage

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