Flutter 源码中 Text widget 的 RenderObject class 在哪里

Where is the RenderObject class for the Text widget in the Flutter source code

我正在研究文本小部件在 Flutter 中的工作方式。我知道小部件只是蓝图。它是实现小部件的元素。该元素创建一个 RenderObject 来在屏幕上布局和绘制小部件。我认为这就是它的工作原理。

但我似乎找不到任何称为 RenderText 的东西。谁在做文本渲染?它的元素是什么?

我找到了。它在 C/C++ 中被称为 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 库。