notify abstract method

void notify([
  1. bool force
])

Triggers a change notification without modifying the value.

Notifies all subscribers that they should re-evaluate. The behavior depends on the force parameter and the specific implementation:

  • When force is true (force update), subscribers are notified regardless of whether the value changed.
  • When force is false (soft update), subscribers are only notified if the value actually changed during recomputation.

This is useful for scenarios like in-place mutations where the value reference doesn't change but the content does.

Parameters:

  • force: If true, forces notification even if the value hasn't changed. The default value depends on the implementation (e.g., false for Computed, true for Signal).

Example:

final list = ListSignal([1, 2, 3]);
list.value.add(4); // Mutation doesn't auto-notify
list.notify(); // Force subscribers to update

final computed = Computed(() => expensiveCalculation());
computed.notify(); // Soft update: only notifies if value changed
computed.notify(true); // Force update: always notifies subscribers

Implementation

void notify([bool force]);