Last updated 22 days ago by Darshan Kawarflutter
As the name suggests,
RichText provides more options to the way a
text is displayed on the screen.
style property of
text widget is used to apply various styles to a text, but a limitation of it is, the style gets applied to the entire text irrespective of whether the text is a single line or multiline. Consider below snippet to render a single line of text on screen:
**'The future belongs to those who prepare for it today.'**)
With above code, if we apply
fontSize as 20,
italic, the style will be applied to entire text, as below.
But, what if, we only want to underline a word from above text or show certain words of text as bold/italic or in different color and rest of the text as normal text?
RichText widget helps to answer and achieve the above cases.