ParagraphBuilder class Null safety

Builds a Paragraph containing text with the given styling information.

To set the paragraph's alignment, truncation, and ellipsizing behavior, pass an appropriately-configured ParagraphStyle object to the constructor.

Then, call combinations of pushStyle, addText, and pop to add styled text to the object.

Finally, call build to obtain the constructed Paragraph object. After this point, the builder is no longer usable.

After constructing a Paragraph, call Paragraph.layout on it and then paint it with Canvas.drawParagraph.


ParagraphBuilder(ParagraphStyle style)
Creates a new ParagraphBuilder object, which is used to create a Paragraph.


hashCode int
The hash code for this object.
placeholderCount int
The number of placeholders currently in the paragraph.
placeholderScales List<double>
The scales of the placeholders in the paragraph.
runtimeType Type
A representation of the runtime type of the object.


addPlaceholder(double width, double height, PlaceholderAlignment alignment, {double scale = 1.0, double? baselineOffset, TextBaseline? baseline}) → void
Adds an inline placeholder space to the paragraph.
addText(String text) → void
Adds the given text to the paragraph.
build() Paragraph
Applies the given paragraph style and returns a Paragraph containing the added text and associated styling.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
pop() → void
Ends the effect of the most recent call to pushStyle.
pushStyle(TextStyle style) → void
Applies the given style to the added text until pop is called.
toString() String
A string representation of this object.


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