dispose method

  1. @override
void dispose()
override

Release any resources held by this node.

Implementation

@override
void dispose() async {
  renderStyle.detach();
  renderStyle.dispose();
  _states.clear();
  style.dispose();
  attributes.clear();
  _connectedCompleter = null;
  _attributeProperties.clear();
  ownerDocument.clearElementStyleDirty(this);
  holderAttachedPositionedElement = null;
  holderAttachedContainingBlockElement = null;
  clearOutOfFlowPositionedElements();
  _beforeElement?.dispose();
  _beforeElement = null;
  _afterElement?.dispose();
  _afterElement = null;
  renderStyle.removeIntersectionChangeListener(_handleIntersectionObserver);
  super.dispose();
}