throwIfDisposed method

void throwIfDisposed([
  1. String? operation
])

Throw if this object has been disposed.

Implementation

void throwIfDisposed([String? operation]) {
  if (_isDisposed) {
    final op = operation ?? 'operation';
    throw StateError('Cannot perform $op on disposed object');
  }
}