onExitRequested property

AppExitRequestCallback? onExitRequested
final

A callback used to ask the application if it will allow exiting the application for cases where the exit is cancelable.

Exiting the application isn't always cancelable, but when it is, this function will be called before exit occurs.

Responding AppExitResponse.exit will continue termination, and responding AppExitResponse.cancel will cancel it. If termination is not canceled, the application will immediately exit.

Implementation

final AppExitRequestCallback? onExitRequested;