Disposable class

Implementers

Constructors

Disposable()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

broadcaster<T>({FutureOr<void> onCancel()?}) StreamController<T>
Creates a StreamController.broadcast that is closed within dispose.
cancelBind(Symbol key) Future<bool>
cancelBindings() Future<void>
Cancel all active listeners, timers and close the controllers. This does not dispose other disposables bound with bind.
cancelTimer(Symbol key) bool
cancelUnique(Symbol id) Future<void>
cancelUniques(Set<Symbol> ids) Future<void>
controller<T>({bool broadcast = false, FutureOr<void> onCancel()?}) StreamController<T>
Creates a StreamController that is closed within dispose.
disposable(Disposable disposable) → void
Binds another Disposable object to be disposed when this is disposed.
dispose() Future<void>
Cancel all active listeners, timers, close the controllers and disposes other disposables bound with bind.
each<T>(Stream<T> stream, void fn(T item), {Symbol? uniqueId}) StreamSubscription<T>
Listens and iterates through stream by calling fn. The listener is disposed in the dispose function.
interval(Duration duration, dynamic fn(Timer), {Symbol? uniqueId, bool execNow = true}) Timer
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
periodic(Duration duration, dynamic fn(Timer), {Symbol? uniqueId}) Timer
Creates a periodic Timer.periodic that gets cancelled within dispose.
reusable() Disposable
streamedInterval<T, E>(Stream<T> valueStream, Duration duration, dynamic fn(T?), {Symbol? uniqueId}) StreamedIntervalTimer
takeFirst<T>(Stream<T> stream) Future<T>
timer(Duration duration, dynamic fn()) Timer
Creates a Timer that gets cancelled within dispose if not executed.
toString() String
A string representation of this object.
inherited
uniqueEach<T>(Symbol id, Stream<T> stream, void fn(T item)) StreamSubscription<T>
Listens and iterates through stream by calling fn. The listener is disposed in the dispose function.
uniqueListen(Symbol id, ChangeNotifier obj, void fn()) → void
Listens and iterates through obj.addListener by calling fn. The listener is disposed in the dispose function.
uniqueTimer(Symbol uniqueId, Duration duration, dynamic fn()) Timer
Creates a Timer that gets cancelled within dispose if not executed.

Operators

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