notify method
Manually notifies all subscribers that this computed value has changed.
This is typically called automatically by the reactive system when dependencies change, but can be called manually for custom scenarios.
Parameters:
force: Iftrue, forces notification even if the value hasn't changed (soft update whenfalse, force update whentrue). Defaults tofalse.
When force is false (soft update), subscribers are only notified if
the computed value actually changed. When force is true (force update),
subscribers are notified regardless of whether the value changed.
Example:
final computed = Computed(() => expensiveCalculation());
computed.notify(); // Soft update: only notifies if value changed
computed.notify(true); // Force update: always notifies subscribers
Implementation
@pragma("vm:prefer-inline")
@pragma("wasm:prefer-inline")
@pragma("dart2js:prefer-inline")
@override
void notify([bool force = false]) {
assert(!isDisposed, "Computed is disposed");
notifyComputed(this, force);
}