Disposable mixin

A mixin to provide disposable behavior to a class.

It manages a disposed state, and can automatically handle closing StreamControllers and cancelling StreamSubscriptions upon disposal.

Mixin applications

Properties

hashCode → int
The hash code for this object.
no setterinherited
isDisposed → bool
Returns true if the object has been disposed.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → Future<void>
Marks the object as disposed and cleans up managed resources.
ensureNotDisposed() → void
Throws a StateError if the object has been disposed.
manageController(StreamController controller) → void
Registers a StreamController to be automatically closed on dispose.
manageSubscription(StreamSubscription subscription) → void
Registers a StreamSubscription to be automatically cancelled on dispose.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited