DisposerMixin mixin

Provides functionality to simplify listening to streams and ValueNotifiers, and disposing FocusNodes.

See also:

Mixin applications

Properties

hashCode int
The hash code for this object.
no setterinherited
listenables List<Listenable>
no setter
listeners List<void Function()>
Not using VoidCallback because of https://github.com/dart-lang/mockito/issues/579
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAutoDisposeListener(Listenable? listenable, [VoidCallback? listener, String? id]) → void
Add a listener to a Listenable object that is automatically removed when cancel is called.
autoDisposeFocusNode(FocusNode? node) → void
Track a focus node that will be automatically disposed on dispose.
autoDisposeStreamSubscription(StreamSubscription subscription) → void
Track a stream subscription to be automatically cancelled on dispose.
callOnceWhenReady<T>({required VoidCallback callback, required ValueListenable<T> trigger, required bool readyWhen(T triggerValue)}) → void
Runs callback when trigger's value satisfies the readyWhen function.
cancelFocusNodes() → void
Cancel all focus nodes added.
cancelListener(VoidCallback? listener) → void
Cancels a single listener, if present.
cancelListeners({List<String> excludeIds = const <String>[]}) → void
Cancel all listeners added.
cancelStreamSubscriptions() → void
Cancel all stream subscriptions added.
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