refreshWith method

void refreshWith(
  1. T newState
)

Replaces the current state with newState and notifies listeners.

Implementation

void refreshWith(T newState) {
  Reactivity.lastStateKey = uniqueKey;
  Reactivity._states[uniqueKey] = BuildState<T>(
    uniqueKey: uniqueKey,
    state: newState,
  );
  Reactivity.notifier.updateState(uniqueKey);
}