assertNotDisposed method

  1. @protected
void assertNotDisposed()

Throws a StateError if this subsystem has already been disposed.

Subclasses can call this at the beginning of public methods to guard against usage after disposal.

Implementation

@protected
void assertNotDisposed() {
  if (_isDisposed) {
    throw StateError(
      'Subsystem "${classDesc.serviceClassId}" has already been disposed '
      'and cannot be used.',
    );
  }
}