Skip to content

WidgetImage

Image element shown in widget.

An image shown in a widget. You do not create instances of this element directly. Instead you should call addImage() on an instance of a ListWidget.

Border color.

borderColor: Color

Color of the border around the image. Defaults to black.

Border width.

borderWidth: number

Width of the border around the image. Defaults to 0.

Shape the image relative to its container.

containerRelativeShape: bool

When true the corners of the image will be rounded relative to the containing widget. The value of cornerRadius is ignored when this is true. Defaults to false.

Radius of the corners.

cornerRadius: number

Radius of the rounded corners. This property is ignored when containerRelativeShape is set to true. Defaults to 0.

Image to show in widget.

image: Image

Opacity when shown in widget.

imageOpacity: number

Opacity of the image. This must be a value between 0 and 1. Defaults to 1.

Size of the image in the widget.

imageSize: Size

Size of the image. When set to null, the image will be shwon at its full size. Defaults to null.

Whether the image is resizable.

resizable: bool

When set to true, the image can be resized. Defaults to true.

Tint color of the image.

tintColor: Color

Changes the color of the image. Set to null to show the original image. Defaults to null.

URL to open.

url: string

The URL will be opened when the text is tapped. This is only supported in medium and large widgets. Small widgets can only have a single tap target, which is specified by the url on the widget.

Uses filling content mode.

applyFillingContentMode()

The image will fill the available space.

Uses fitting content mode.

applyFittingContentMode()

The image will fit the available space. This content mode is the default.

Center aligns the image.

centerAlignImage()

Specifies that image should be center aligned.

Left aligns the image.

leftAlignImage()

Specifies that image should be left aligned. This is the default.

Right aligns the image.

rightAlignImage()

Specifies that image should be right aligned.