didRequestAppExit method

Future<AppExitResponse> didRequestAppExit()

Called when a request is received from the system to exit the application. Exiting the application can proceed with AppExitResponse.exit; Cancel and do not exit the application with AppExitResponse.cancel;

Implementation

// To override WidgetsBindingObserver.didRequestAppExit()
Future<AppExitResponse> didRequestAppExit() async {
  // Record the triggered event
  assert(() {
    if (_debugPrintEvents) {
      debugPrint(
          '$_consoleLeadingLine didRequestAppExit() in $_consoleClassName');
    }
    return true;
  }());
  return AppExitResponse.exit;
}