ImageDrawable class
A drawable of an image as an object.
- Inheritance
-
- Object
- Drawable
- ObjectDrawable
- ImageDrawable
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, 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, required Image image, bool flipped = false}) -
Creates an ImageDrawable with the given
image, and calculates the scale based on the givensize. 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.
no setterinherited
-
Whether the drawable is hidden or not.
finalinherited
- image → Image
-
The image to be drawn.
final
- isHidden → bool
-
no setterinherited
- isNotHidden → bool
-
no setterinherited
- 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
-
no setterinherited
- 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.
no setterinherited
- scale → double
-
The scale of the object to be painted.
finalinherited
Methods
-
copyWith(
{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
canvasof sizesize.inherited -
drawAssists(
Canvas canvas, Size size) → void -
Draws any assist lines that the object has on
canvaswithsize.inherited -
drawObject(
Canvas canvas, Size size) → void -
Draws the image on the provided
canvasof sizesize.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 nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited