observe abstract method
void
observe({
- required Model? modelPrevious,
- required Model? modelCurrent,
- bool? isDistinct,
- StoreConnectorInterface? storeConnector,
- int? reduceCount,
- int? dispatchCount,
The ModelObserver can be used to observe and troubleshoot the model changes.
The storeConnector
works by rebuilding the widget when the model changes.
It needs to compare the modelPrevious
with the modelCurrent
to decide if the widget should
rebuild:
isDistinct
istrue
means the widget rebuilt because the model changed.isDistinct
isfalse
means the widget didn't rebuilt because the model hasn't changed.isDistinct
isnull
means the widget rebuilds everytime (because of theStoreConnector.distinct
parameter), and the model is not relevant.
Implementation
void observe({
required Model? modelPrevious,
required Model? modelCurrent,
bool? isDistinct,
StoreConnectorInterface? storeConnector,
int? reduceCount,
int? dispatchCount,
});