dispose method

void dispose()

Disposes this object and release resources.

Implementation

void dispose() {
  // TODO(polina-c): stop duplicating code across disposables
  // https://github.com/flutter/flutter/issues/137435
  if (kFlutterMemoryAllocationsEnabled) {
    FlutterMemoryAllocations.instance.dispatchObjectDisposed(object: this);
  }
  _selectionOverlay.dispose();
  renderObject.selectionStartInViewport.removeListener(_updateTextSelectionOverlayVisibilities);
  renderObject.selectionEndInViewport.removeListener(_updateTextSelectionOverlayVisibilities);
  _effectiveToolbarVisibility.dispose();
  _effectiveStartHandleVisibility.dispose();
  _effectiveEndHandleVisibility.dispose();
  hideToolbar();
}