dispose method

void dispose()

Unmounts the tree so every State disposes, then releases the pipeline.

Implementation

void dispose() {
  // The childless adapter only marks the root dirty; the buildScope is
  // what actually swaps the child out and deactivates the subtree, and
  // finalizeTree is what unmounts it. Without the drain, nothing ever
  // unmounted and a resident guest leaked one whole tree per render.
  RenderObjectToWidgetAdapter<RenderBox>(container: boundary)
      .attachToRenderTree(_buildOwner, _element);
  _buildOwner.buildScope(_element);
  _buildOwner.finalizeTree();
  _pipelineOwner.rootNode = null;
  _renderView.child = null;
  boundary.dispose();
  _renderView.dispose();
  _pipelineOwner.dispose();
  _buildOwner.focusManager.dispose();
}