OnWillChangeCallback<ViewModel> typedef

void OnWillChangeCallback (ViewModel viewModel)

A function that will be run on State change, before the build method.

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


typedef OnWillChangeCallback<ViewModel> = void Function(ViewModel viewModel);