ParagraphTextElement class

A TextElement holding a block of rich text that was laid out by Flutter's paragraph engine.

The element owns the laid out TextPainter; call dispose once the element is no longer needed to release it.

Wraps a text painter that has already had layout called on it.

Inheritance

Constructors

ParagraphTextElement(TextPainter _textPainter)
ParagraphTextElement.layout(InlineSpan text, {required double maxWidth, TextAlign textAlign = TextAlign.start, TextDirection textDirection = TextDirection.ltr})
Lays out text within maxWidth and wraps the resulting painter.

Properties

boundingBox → Rect
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
height → double
The height of the laid out paragraph.
no setter
lineMetrics → List<LineMetrics>
Measurements of each laid out line, relative to offset.
no setter
lines → List<String>
The text that ended up on each line after line breaking.
no setter
offset → Offset
The position of the paragraph's top left corner.
no setter
plainText → String
The whole text of this paragraph, without any styling.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textPainter → TextPainter
no setter
width → double
The width of the laid out paragraph.
no setter

Methods

dispose() → void
Releases any native resources held by this element.
override
draw(Canvas canvas) → void
Renders the element on the canvas, at coordinates determined during the layout.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
translate(double dx, double dy) → void
Moves the element by (dx, dy) relative to its current location.
override

Operators

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