isDisposedOrDisposing property

bool isDisposedOrDisposing

Whether this object has been disposed or is currently disposing.

This will become true after dispose is called, but not until all Futures registered via awaitBeforeDispose have resolved, and will remain true forever.

This is equivalent to:

object.isDisposed || object.isDisposing

Deprecated: 1.9.0 To be removed: 2.0.0

This was intended as a convenience method to be used to guard against APIs being called after disposal has started. Consumers should now use isOrWillBeDisposed instead because it also returns true when this instance is in the "awaiting disposal" state that is entered as soon as dispose is called, whereas this getter does not return true until disposal has actually started.

Implementation

@deprecated
bool get isDisposedOrDisposing => isDisposed || isDisposing;