onDispose property
(dynamic Function(T viewModel)?)
onDispose
final
Fires when the widget has been removed from the widget tree and allows you to dispose of any controllers or state values that need disposing
Implementation
final Function(T viewModel)? onDispose;