RichText
Renders a TextSpan tree: multiple styles on a line, with the same
wrapping, maxLines, and overflow behavior as Text. The ambient
DefaultTextStyle is the base the root span merges onto.
See also: Text when one style covers the whole string.
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
RichText(text: TextSpan(children: [ TextSpan(text: 'deploy '), TextSpan(text: 'ok', style: CellStyle(bold: true)),]))Details
Section titled “Details”Participates in app-wide text selection: drag, double-click, and
Shift+Arrow work across mixed Text and RichText widgets inside
a SelectionArea. The selected copy is the plain text of the spans
— styles are visual only, never round-tripped to the clipboard.
Set allowSelect: false to mask a particular RichText off from
any ambient SelectionArea.
Constructors
Section titled “Constructors”RichText()
Section titled “RichText()”| Parameter | Type | Default | Description |
|---|---|---|---|
text: | TextSpan | required | Root of the styled span tree to render. |
softWrap: | bool | true | Whether content wraps to additional rows at the available width. |
maxLines: | int? | — | Maximum rendered rows, or null for no explicit line limit. |
overflow: | TextOverflow | TextOverflow.clip | How content beyond the width or maxLines budget is represented. |
allowSelect: | bool | true | Whether this RichText participates in ambient SelectionArea selection. When false, the widget is invisible to selection: drags pass over without highlight, Ctrl+A skips the content. Defaults to true. |
Source
Section titled “Source”RichText is defined in packages/fleury/lib/src/widgets/rich_text.dart.
Category: Text & content · All widgets