TextDrawable class

Text Drawable

Inheritance

Constructors

TextDrawable({required String text, required Offset position, double rotation = 0, double scale = 1, TextStyle style = const TextStyle(fontSize: 14, color: Colors.black), TextDirection direction = TextDirection.ltr, TextAlign textAlign = TextAlign.center, bool locked = false, bool hidden = false, Set<ObjectDrawableAssist> assists = const <ObjectDrawableAssist>{}, Map<ObjectDrawableAssist, Paint> assistPaints = const <ObjectDrawableAssist, Paint>{}})
Creates a TextDrawable to draw text.

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
direction → TextDirection
The direction of the text to be drawn.
final
erasable → bool
Whether free-style erasing can affect this drawable.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hidden → bool
Whether the drawable is hidden or not.
finalinherited
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
style → TextStyle
The style the text will be drawn with.
final
text → String
The text to be drawn.
final
textAlign → TextAlign
The alignment of the text within its available layout width.
final
textPainter → TextPainter
final

Methods

copyWith({bool? hidden, Set<ObjectDrawableAssist>? assists, Map<ObjectDrawableAssist, Paint>? assistPaints, String? text, Offset? position, double? rotation, double? scale, TextStyle? style, bool? locked, TextDirection? direction, TextAlign? textAlign}) → TextDrawable
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 text 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 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