Paragraph class

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.

Properties

alphabeticBaseline double
The distance from the top of the paragraph to the alphabetic baseline of the first line, in logical pixels.
read-only
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. [...]
read-only
height double
The amount of vertical space this paragraph occupies. [...]
read-only
ideographicBaseline double
The distance from the top of the paragraph to the ideographic baseline of the first line, in logical pixels.
read-only
longestLine double
The distance from the left edge of the leftmost glyph to the right edge of the rightmost glyph in the paragraph. [...]
read-only
maxIntrinsicWidth double
Returns the smallest width beyond which increasing the width never decreases the height. [...]
read-only
minIntrinsicWidth double
The minimum width that this paragraph could be without failing to paint its contents within itself. [...]
read-only
width double
The amount of horizontal space this paragraph occupies. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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. [...]
getPositionForOffset(Offset offset) TextPosition
Returns the text position closest to the given offset.
getWordBoundary(int offset) List<int>
Returns the start, end of the word at the given offset. Characters not part of a word, such as spaces, symbols, and punctuation, have word breaks on both sides. In such cases, this method will return offset, offset+1. Word boundaries are defined more precisely in Unicode Standard Annex #29 http://www.unicode.org/reports/tr29/#Word_Boundaries
layout(ParagraphConstraints constraints) → void
Computes the size and position of each glyph in the paragraph. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited