OnWillChangeCallback<St, Model> typedef

OnWillChangeCallback<St, Model> = void Function(BuildContext? context, Store<St> store, Model previousVm, Model newVm)

A function that will be run on state change, before the build method. This function is passed the Model, and if distinct is true, it will only be called if the Model changes. This is useful for making calls to other classes, such as a Navigator or TabController, in response to state changes. It can also be used to trigger an action based on the previous state.

Implementation

typedef OnWillChangeCallback<St, Model> = void Function(
    BuildContext? context, Store<St> store, Model previousVm, Model newVm);