throwIfDisposed method

void throwIfDisposed()

Throws a StateError if the instance is disposed.

Ensures that the instance is not disposed before proceeding with operations that require an active instance.

Implementation

void throwIfDisposed() {
  if (!isInitialised) {
    throw StateError(
      'The instance must not be disposed before calling this method.',
    );
  }
}