RichText class

Rich text with per-span styling, with Bangla shaped correctly.

Mirrors pw.RichText. Spans containing Bangla are shaped and flowed as separate runs; a tree with no Bangla in it is passed to pw.RichText untouched, so existing layouts are unaffected.

Inheritance

Constructors

RichText({required InlineSpan text, TextAlign? textAlign, TextDirection? textDirection, bool? softWrap, bool tightBounds = false, double textScaleFactor = 1.0, int? maxLines, TextOverflow overflow = pw.TextOverflow.visible, Hyphenation? hyphenation})
Creates a RichText.

Properties

box ↔ PdfRect?
The bounding box of this widget, calculated at layout time
getter/setter pairinherited
canSpan bool
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasMoreWidgets bool
no setterinherited
hyphenation Hyphenation?
Word-breaking callback, as in pw.RichText.hyphenation.
final
maxLines int?
Maximum number of lines before overflowing.
final
overflow TextOverflow
How overflow is handled.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
softWrap bool?
Whether text breaks at soft line breaks.
final
text InlineSpan
The span tree to lay out.
final
textAlign TextAlign?
Horizontal alignment.
final
textDirection TextDirection?
Reading direction.
final
textScaleFactor double
Multiplier applied to every font size.
final
tightBounds bool
Whether the box hugs the text.
final

Methods

applyContext(covariant WidgetContext context) → void
Called before relayout to restore the saved state and restart the layout in the same conditions
inherited
build(Context context) Widget
override
cloneContext() WidgetContext
Called after layout to save the state
inherited
debugPaint(Context context) → void
inherited
layout(Context context, BoxConstraints constraints, {bool parentUsesSize = false}) → void
First widget pass to calculate the children layout and bounding box
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(Context context) → void
Draw itself and its children, according to the calculated box.offset
inherited
restoreContext(covariant WidgetContext context) → void
Apply the context for next page layout. Called before layout to prepare for next page
inherited
saveContext() WidgetContext
Get unmodified mutable context object
inherited
toString() String
A string representation of this object.
inherited

Operators

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