changeModel<T> method

void changeModel<T>(
  1. Symbol key,
  2. T value
)

Change the data of the model with the given key. Throws an assertion error if the model is read-only.

  • T The type of the data.
  • context The build context.
  • key The data key.
  • data The new data.

Implementation

void changeModel<T>(Symbol key, T value) {
  assert(state.mounted, 'State is not mounted');
  Model.change<T>(state.context, key, value);
}