attachTo method
Attach a renderObject to parent.
Implementation
@override
void attachTo(Element parent, {RenderBox? after}) {
// Empty string of TextNode should not attach to render tree.
if (_data.isEmpty) return;
createRenderer();
// If element attach WidgetElement, render object should be attach to render tree when mount.
if (parent.renderObjectManagerType == RenderObjectManagerType.WEBF_NODE && parent.renderBoxModel != null) {
ContainerRenderObjectMixin? parentRenderBox;
if (parent.renderBoxModel is RenderLayoutBox) {
final layoutBox = parent.renderBoxModel as RenderLayoutBox;
parentRenderBox = layoutBox.renderScrollingContent ?? layoutBox;
} else if (parent.renderBoxModel is RenderSVGText) {
(parent.renderBoxModel as RenderSVGText).child = _renderTextBox;
}
if (parentRenderBox != null) {
parentRenderBox.insert(_renderTextBox!, after: after);
}
}
_applyTextStyle();
}