attachRenderObject method

  1. @override
void attachRenderObject (dynamic newSlot)

Add renderObject to the render tree at the location specified by slot.

The default implementation of this function simply calls attachRenderObject recursively on its child. The RenderObjectElement.attachRenderObject override does the actual work of adding renderObject to the render tree.


void attachRenderObject(dynamic newSlot) {
  assert(_ancestorRenderObjectElement == null);
  _slot = newSlot;
  _ancestorRenderObjectElement = _findAncestorRenderObjectElement();
  _ancestorRenderObjectElement?.insertChildRenderObject(renderObject, newSlot);
  final ParentDataElement<RenderObjectWidget> parentDataElement = _findAncestorParentDataElement();
  if (parentDataElement != null)