DecorationImage class

An image for a box decoration.

The image is painted using paintImage, which describes the meanings of the various fields on this class in more detail.

Annotations

Constructors

DecorationImage({required ImageProvider<Object> image, ImageErrorListener? onError, ColorFilter? colorFilter, BoxFit? fit, AlignmentGeometry alignment = Alignment.center, Rect? centerSlice, ImageRepeat repeat = ImageRepeat.noRepeat, bool matchTextDirection = false, double scale = 1.0, double opacity = 1.0, FilterQuality filterQuality = FilterQuality.low, bool invertColors = false, bool isAntiAlias = false})
Creates an image to show in a BoxDecoration.
const

Properties

alignment AlignmentGeometry
How to align the image within its bounds.
final
centerSlice Rect?
The center slice for a nine-patch image.
final
colorFilter ColorFilter?
A color filter to apply to the image before painting it.
final
filterQuality FilterQuality
Used to set the filterQuality of the image.
final
fit BoxFit?
How the image should be inscribed into the box.
final
hashCode int
The hash code for this object.
no setteroverride
image ImageProvider<Object>
The image to be painted into the decoration.
final
invertColors bool
Whether the colors of the image are inverted when drawn.
final
isAntiAlias bool
Whether to paint the image with anti-aliasing.
final
matchTextDirection bool
Whether to paint the image in the direction of the TextDirection.
final
onError ImageErrorListener?
An optional error callback for errors emitted when loading image.
final
opacity double
If non-null, the value is multiplied with the opacity of each image pixel before painting onto the canvas.
final
repeat ImageRepeat
How to paint any portions of the box that would not otherwise be covered by the image.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
Defines image pixels to be shown per logical pixels.
final

Methods

createPainter(VoidCallback onChanged) DecorationImagePainter
Creates a DecorationImagePainter for this DecorationImage.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

lerp(DecorationImage? a, DecorationImage? b, double t) DecorationImage?
Linearly interpolates between two DecorationImages.