onExit method

  1. @override
Future onExit()
override

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!();
  }
}