onExit method
This method will be called before removing the page from the stack and before the page is disposed this is useful for saving data before the page is removed
Implementation
@override
Future onExit() async {
if (onExitFunc != null) {
await onExitFunc!();
}
}