In Flutter, RichText is a widget that helps us to add more styling to a paragraph of text. Otherwise we cannot do that.

However, with Text widget we cannot achieve the same effect.

In RichText widget, we can return several TextSpan widgets and, moreover, in each TextSpan we can add different type of styling.

Not only that, the TextSpan is a subclass of InLineSpan class that is actually an immutable span of inline content, or text that forms a part of a paragraph.

In addition, the TextSpan widget has a Gesture Detector property called recognizer. Using recognizer we can easily build a navigation link in that particular part of paragraph.

In short, RichText widget gives us multiple advantages to style a paragraph of Text.

How we can do that?

Read More...


This free site is ad-supported. Learn more