Paragraph class abstract

A paragraph of text.

A paragraph retains the size and position of each glyph in the text and can be efficiently resized and painted.

To create a Paragraph object, use a ParagraphBuilder.

Paragraphs can be displayed on a Canvas using the Canvas.drawParagraph method.

Constructors

Paragraph()

Properties

alphabeticBaseline double
The distance from the top of the paragraph to the alphabetic baseline of the first line, in logical pixels.
no setter
debugDisposed bool
Whether this reference to the underlying picture is disposed.
no setter
didExceedMaxLines bool
True if there is more vertical content, but the text was truncated, either because we reached maxLines lines of text or because the maxLines was null, ellipsis was not null, and one of the lines exceeded the width constraint.
no setter
hashCode int
The hash code for this object.
no setterinherited
height double
The amount of vertical space this paragraph occupies.
no setter
ideographicBaseline double
The distance from the top of the paragraph to the ideographic baseline of the first line, in logical pixels.
no setter
longestLine double
The distance from the left edge of the leftmost glyph to the right edge of the rightmost glyph in the paragraph.
no setter
maxIntrinsicWidth double
Returns the smallest width beyond which increasing the width never decreases the height.
no setter
minIntrinsicWidth double
The minimum width that this paragraph could be without failing to paint its contents within itself.
no setter
numberOfLines int
The total number of visible lines in the paragraph.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double
The amount of horizontal space this paragraph occupies.
no setter

Methods

computeLineMetrics() List<LineMetrics>
Returns the full list of LineMetrics that describe in detail the various metrics of each laid out line.
dispose() → void
Release the resources used by this object. The object is no longer usable after this method is called.
getBoxesForPlaceholders() List<TextBox>
Returns a list of text boxes that enclose all placeholders in the paragraph.
getBoxesForRange(int start, int end, {BoxHeightStyle boxHeightStyle = BoxHeightStyle.tight, BoxWidthStyle boxWidthStyle = BoxWidthStyle.tight}) List<TextBox>
Returns a list of text boxes that enclose the given text range.
getClosestGlyphInfoForOffset(Offset offset) GlyphInfo?
Returns the GlyphInfo of the glyph closest to the given offset in the paragraph coordinate system, or null if if the text is empty, or is entirely clipped or ellipsized away.
getGlyphInfoAt(int codeUnitOffset) GlyphInfo?
Returns the GlyphInfo located at the given UTF-16 codeUnitOffset in the paragraph, or null if the given codeUnitOffset is out of the visible lines or is ellipsized.
getLineBoundary(TextPosition position) TextRange
Returns the TextRange of the line at the given TextPosition.
getLineMetricsAt(int lineNumber) LineMetrics?
Returns the LineMetrics for the line at lineNumber, or null if the given lineNumber is greater than or equal to numberOfLines.
getLineNumberAt(int codeUnitOffset) int?
Returns the line number of the line that contains the code unit that codeUnitOffset points to.
getPositionForOffset(Offset offset) TextPosition
Returns the text position closest to the given offset.
getWordBoundary(TextPosition position) TextRange
Returns the TextRange of the word at the given TextPosition.
layout(ParagraphConstraints constraints) → void
Computes the size and position of each glyph in the paragraph.
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