run method

  1. @override
void run()
override

Manually runs the effect function immediately, bypassing frame scheduling.

This establishes the effect as the current reactive context, allowing it to track dependencies accessed during execution.

Example:

final effect = FlutterEffect(() => print('Hello'), lazy: false);
effect.run(); // Prints: "Hello" immediately

Implementation

@override
void run() {
  assert(!isDisposed, "FlutterEffect is disposed");
  flags |= ReactiveFlags.dirty;
  runEffect();
}