ImageDrawable class Null safety

A drawable of an image as an object.

Inheritance

Constructors

ImageDrawable({required Offset position, double rotationAngle = 0, double scale = 1, Set<ObjectDrawableAssist> assists = const <ObjectDrawableAssist>{}, Map<ObjectDrawableAssist, Paint> assistPaints = const <ObjectDrawableAssist, Paint>{}, bool locked = false, bool hidden = false, required Image image, bool flipped = false})
Creates an ImageDrawable with the given image.
ImageDrawable.fittedToSize({required Offset position, required Size size, double rotationAngle = 0, Set<ObjectDrawableAssist> assists = const <ObjectDrawableAssist>{}, Map<ObjectDrawableAssist, Paint> assistPaints = const <ObjectDrawableAssist, Paint>{}, bool locked = false, bool hidden = false, required Image image, bool flipped = false})
Creates an ImageDrawable with the given image, and calculates the scale based on the given size. The scale will be calculated such that the size of the drawable fits into the provided size.

Properties

assistPaints Map<ObjectDrawableAssist, Paint>
The paint to be used for each assist type.
finalinherited
assists Set<ObjectDrawableAssist>
The current assist lines the object has.
finalinherited
flipped bool
Whether the image is flipped or not.
final
hashCode int
The hash code for this object.
read-onlyinherited
hidden bool
Whether the drawable is hidden or not.
finalinherited
image Image
The image to be drawn.
final
isHidden bool
read-onlyinherited
isNotHidden bool
read-onlyinherited
locked bool
Defines if the object drawable is locked or not. If it is locked, it won't be movable, scalable or re-sizable using the UI.
finalinherited
min_scale double
read-onlyinherited
position Offset
The location of the object to be painted.
finalinherited
rotationAngle double
The rotation of the object to be painted in radians.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
scale double
The scale of the object to be painted.
finalinherited

Methods

copyWith({bool? hidden, Set<ObjectDrawableAssist>? assists, Offset? position, double? rotation, double? scale, Image? image, bool? flipped, bool? locked}) ImageDrawable
Creates a copy of this but with the given fields replaced with the new values.
override
draw(Canvas canvas, Size size) → void
Draws the object on the provided canvas of size size.
inherited
drawAssists(Canvas canvas, Size size) → void
Draws any assist lines that the object has on canvas with size.
inherited
drawObject(Canvas canvas, Size size) → void
Draws the image on the provided canvas of size size.
override
getSize({double minWidth = 0.0, double maxWidth = double.infinity}) Size
Calculates the size of the rendered object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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