dispose method

  1. @mustCallSuper
void dispose ()

Closes the semantics handle and stops calling listener when the semantics updates.

When all the outstanding SemanticsHandle objects for a given PipelineOwner are closed, the PipelineOwner will stop updating the semantics tree.


void dispose() {
  assert(() {
    if (_owner == null) {
      throw FlutterError(
        'SemanticsHandle has already been disposed.\n'
        'Each SemanticsHandle should be disposed exactly once.'
    return true;
  if (_owner != null) {
    if (listener != null)
    _owner = null;