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.
Properties
Section titled “Properties”borderColor
Section titled “borderColor”Border color.
borderColor: ColorColor of the border around the image. Defaults to black.
borderWidth
Section titled “borderWidth”Border width.
borderWidth: numberWidth of the border around the image. Defaults to 0.
containerRelativeShape
Section titled “containerRelativeShape”Shape the image relative to its container.
containerRelativeShape: boolWhen 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.
cornerRadius
Section titled “cornerRadius”Radius of the corners.
cornerRadius: numberRadius of the rounded corners. This property is ignored when containerRelativeShape is set to true. Defaults to 0.
Image to show in widget.
image: ImageimageOpacity
Section titled “imageOpacity”Opacity when shown in widget.
imageOpacity: numberOpacity of the image. This must be a value between 0 and 1. Defaults to 1.
imageSize
Section titled “imageSize”Size of the image in the widget.
imageSize: SizeSize of the image. When set to null, the image will be shwon at its full size. Defaults to null.
resizable
Section titled “resizable”Whether the image is resizable.
resizable: boolWhen set to true, the image can be resized. Defaults to true.
tintColor
Section titled “tintColor”Tint color of the image.
tintColor: ColorChanges the color of the image. Set to null to show the original image. Defaults to null.
URL to open.
url: stringThe 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.
Methods
Section titled “Methods”
applyFillingContentMode()
Section titled “applyFillingContentMode()”Uses filling content mode.
applyFillingContentMode()The image will fill the available space.
applyFittingContentMode()
Section titled “applyFittingContentMode()”Uses fitting content mode.
applyFittingContentMode()The image will fit the available space. This content mode is the default.
centerAlignImage()
Section titled “centerAlignImage()”Center aligns the image.
centerAlignImage()Specifies that image should be center aligned.
leftAlignImage()
Section titled “leftAlignImage()”Left aligns the image.
leftAlignImage()Specifies that image should be left aligned. This is the default.
rightAlignImage()
Section titled “rightAlignImage()”Right aligns the image.
rightAlignImage()Specifies that image should be right aligned.