addUpdate method

void addUpdate(
  1. Key key,
  2. UniqueKey uniqueKey,
  3. State<StatefulWidget> state
)

Registers a widget’s subscription to reactive updates for a given key.

This is typically called in a widget’s initState().

Implementation

void addUpdate(Key key, UniqueKey uniqueKey, State state) {
  final notifier = Notifier(
    uniqueKey,
    state.setState,
  );
  _updates.putIfAbsent(key, () => <Notifier>[]).add(notifier);
}