RichText

This widget motivated by RichText in Flutter.

The RichText widget displays text that uses multiple different styles. The text to display is described using a tree of TextSpan objects, each of which has an associated style that is used for that subtree. The text might break across multiple lines or might all be displayed on the same line depending on the layout constraints.

Text displayed in a RichText widget must be explicitly styled. When picking which style to use, consider using DefaultTextStyle.of the current BuildContext to provide defaults. For more details on how to style text in a RichText widget, see the documentation for TextStyle.

Consider using the Text widget to integrate with the DefaultTextStyle automatically. When all the text uses the same style, the default constructor is less verbose. The Text.rich constructor allows you to style multiple spans with the default text style while still allowing specified styles per span.

See: https://api.flutter.dev/flutter/widgets/RichText-class.html

Props

text

Value: InlineSpan | undefined

textOverflow

Value: textOverflow (default: TextOverflow.clip)

softWrap

Value: boolean (default: true))

textWidthBasis

Value: TextWidthBasis (default: TextWidthBasis.parent))

textAlign

**Value: textAlign ** (default: textAlign.start))

maxlines

Value: number | undefined

Examples

Basic