CloseableResources mixin
Adds convenience methods on ChangeNotifier to register common closeable resources. These are closed when the dispose method is called.
Note that resources can only be registered once. Registering multiple times will fail an assertion, and will likely misbehave in production
- Superclass constraints
- Mixin applications
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
override
-
listenToStream<
U> (Stream< U> stream) → void - Registers a Stream to be automatically listened to and cancelled when the dispose method is called.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
registerSink<
S> (Sink< S> sink) → void - Registers a Sink to be automatically closed when the dispose method is called.
-
registerStreamSubscription<
S> (StreamSubscription< S> subscription) → void - Registers a StreamSubscription to be automatically cancelled when the dispose method is called.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited