detachRenderObject method

  1. @override
void detachRenderObject()
override

Remove renderObject from the render tree.

The default implementation of this function calls detachRenderObject recursively on each child. The RenderObjectElement.detachRenderObject override does the actual work of removing renderObject from the render tree.

This is called by deactivateChild.

Implementation

@override
void detachRenderObject() {
  if (_ancestorRenderObjectElement != null) {
    _ancestorRenderObjectElement!.removeRenderObjectChild(renderObject, slot);
    _ancestorRenderObjectElement = null;
  }
  _slot = null;
}