DisposableMixin mixin

This mixin adds an easy option to dispose streams without having to store a StreamSubscription variable.

{@tool snippet} Typical usage is as follows:

class ExampleProvider with DisposableMixin {
  void init() {
    _stream.takeUntil(dispose$).listen(_handleStream);
  }
}

{@end-tool}

Properties

dispose$ Stream<void>
The Stream that emits null when the dispose method is called.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Dispose the object and emit null to the dispose$ stream.
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