FlutterEffectImpl class
Implementation of FlutterEffect that schedules execution at the end of the current Flutter frame.
This effect batches multiple triggers within the same frame and executes only once at the end of the frame, avoiding unnecessary repeated executions during frame rendering.
Example:
final count = Signal(0);
// Effect runs once at end of frame, even if count changes multiple times
final effect = FlutterEffect(() {
print('Count is: ${count.value}');
});
count.value = 1;
count.value = 2;
count.value = 3;
// Effect executes once at end of frame with count.value = 3
- Inheritance
-
- Object
- ReactiveNode
- EffectReactiveNode
- FlutterEffectImpl
- Implemented types
- Mixed-in types
Constructors
- FlutterEffectImpl(void fn(), {bool lazy = false, JoltDebugFn? onDebug})
- Creates a new Flutter effect with the given function.
- FlutterEffectImpl.lazy(void fn(), {JoltDebugFn? onDebug})
-
Creates a new Flutter effect that runs immediately upon creation.
factory
Properties
- deps ↔ Link?
-
First dependency link in the chain.
getter/setter pairinherited
- depsTail ↔ Link?
-
Last dependency link in the chain.
getter/setter pairinherited
- flags ↔ int
-
Reactive flags for this node.
getter/setter pairinherited
- fn → void Function()
-
The function that defines the effect's behavior.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subs ↔ Link?
-
First subscriber link in the chain.
getter/setter pairinherited
- subsTail ↔ Link?
-
Last subscriber link in the chain.
getter/setter pairinherited
Methods
-
dispose(
) → void -
Disposes this node and cleans up resources.
inherited
-
doCleanup(
) → void -
Executes all registered cleanup functions and clears the cleanup list.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCleanUp(
Disposer fn) → void -
Registers a cleanup function to be called when this effect is disposed or re-run.
inherited
-
onDispose(
) → void -
Called during the disposal process to perform custom cleanup.
override
-
run(
) → void -
Manually runs the effect function immediately, bypassing frame scheduling.
override
-
runEffect(
) → void -
Executes the effect when it is dirty or pending.
override
-
schedule(
) → bool -
Schedules this effect to run at the end of the current Flutter frame.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
wrappedFn(
) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited