onWillChange property
A function that will be run on State change, before the Widget is built.
This function is passed the ViewModel
, and if distinct
is true
,
it will only be called if the ViewModel
changes.
This can be useful for imperative calls to things like Navigator, TabController, etc. This can also be useful for triggering actions based on the previous state.
Implementation
final OnWillChangeCallback<ViewModel>? onWillChange;