write<Model extends BaseUIModel> method
AppState
write<Model extends BaseUIModel>(
- Model defaultModel,
- void f(
- Model m
- bool overwrite = false
Writes the data of the model of type BaseUIModel in the store
The key used for the model must be guaranteed as unique by the developer
across the whole app. Setting overwrite
to true forces write not to
reuse any portion of the Model
in the Store.
Implementation
@override
AppState write<Model extends BaseUIModel>(
Model defaultModel, void Function(Model m) f,
[bool overwrite = false]) =>
this.state.copy(
key: defaultModel.$key,
value: mutate(defaultModel, f, overwrite),
);