I'm researching how the Text widget works in Flutter. I know that the widgets are just blueprints. It is the Element that implements the widget. And the element makes a RenderObject to layout and paint the widget on the screen. I think that's how it works anyway.
But I can't seem to find anything called a RenderText
. Who is doing the text rendering? What is its Element?
I found it. It is called RenderParagraph
, not RenderText
. The Text
widget creates a RichText
widget in its build method. RenderParagraph
is the RenderObject
corresponding to the RichText
widget. Another important class is TextPainter
, which is used by RenderParagraph
to coordinate painting the paragraph text. The painting itself is done even lower down in the LibTxt library in C/C++.