ensureSemantics method

SemanticsHandle ensureSemantics()

Creates a new SemanticsHandle and requests the collection of semantics information.

Semantics information are only collected when there are clients interested in them. These clients express their interest by holding a SemanticsHandle.

Clients can close their SemanticsHandle by calling SemanticsHandle.dispose. Once all outstanding SemanticsHandle objects are closed, semantics information are no longer collected.


SemanticsHandle ensureSemantics() {
  assert(_outstandingHandles >= 0);
  assert(_outstandingHandles > 0);
  _semanticsEnabled.value = true;
  return SemanticsHandle._(_didDisposeSemanticsHandle);