dispose method

  1. @mustCallSuper
void dispose()

Closes the semantics handle.

When all the outstanding SemanticsHandle objects are closed, the framework will stop generating semantics information.

Implementation

@mustCallSuper
void dispose() {
  // TODO(polina-c): stop duplicating code across disposables
  // https://github.com/flutter/flutter/issues/137435
  if (kFlutterMemoryAllocationsEnabled) {
    FlutterMemoryAllocations.instance.dispatchObjectDisposed(object: this);
  }

  _onDispose();
}