Image

The Image widget is used to display images. It can handle various image types, including raster formats (like PNG, JPEG) and vector formats (SVG), from different sources like network URLs or local project assets.

Properties

Property
Description

source

The source of the image. Can be network or asset.

imageSrc

The URL or asset path for the image file.

imageType

The type of the image, such as image, svg, or avif. auto attempts to determine the type.

fit

How the image should be inscribed into the widget's bounds. Options include cover, contain, fill, fitWidth, fitHeight, and none.

opacity

The transparency of the image, from 0.0 (fully transparent) to 1.0 (fully opaque).

svgColor

If the image is an SVG, this property can be used to apply a solid color to it.

Placeholder & Error Properties

Property
Description

placeholder

The type of placeholder to show while the image is loading (e.g., none, blurHash).

placeholderSrc

The source for the placeholder, such as a BlurHash string.

errorImage.errorEnabled

If true, a fallback image will be shown if the primary image fails to load.

errorImage.errorSrc

The URL or asset path for the fallback error image.


Default Properties

The Image widget supports all three sections of default properties:

Layout

  • width

  • height

  • padding

  • margin

  • align

Appearance

  • bgColor

  • borderRadius

  • border

    • borderWidth

    • borderColor

    • borderType (e.g., solid, dashed)

    • strokeAlign

Interactions

  • onClick — Used to add actions to the Image widget.

Last updated