StreamSubscriptionMixin mixin
A mixin that manages stream subscriptions.
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
-
cancelScopedSubscriptions(
String scope) → void -
Only cancels the subscriptions in the given
scope. -
cancelSubscriptions(
) → void - Cancels all the subscriptions in the all scopes. This is suitable to be called when disposing the object.
-
listenTo<
T> (Stream< T> stream, void onData(T event)?, {Function? onError, void onDone()?, bool? cancelOnError, String scope = defaultScope}) → StreamSubscription<T> -
Listens to the given
streamand adds the subscription to the givenscope. If the scope is not provided, the subscription is added to the default scope StreamSubscriptionMixin.defaultScope. Which means when cancelSubscriptions is called, all the subscriptions in the default scope are cancelled. -
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
Constants
- defaultScope → const String
- Default scope to add subscriptions to. This is used when no scope is provided.