A scope that manages a collection of effects.
EffectScope provides a way to group multiple effects together and dispose of them all at once. Any effects created within the scope will be automatically linked to it.
Use the call method to stop all effects within this scope.
Example:
final scope = effectScope(() {
effect(() => print('Effect 1'));
effect(() => print('Effect 2'));
});
// Later, stop all effects in the scope:
scope();
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
-
call(
) → void - Stops all effects within this scope.
-
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