onWillPop property
If you want to perform a custom action on Android when exiting the app, you can write your logic here. Returns context of the selected screen. If you to exit the app make sure to set handleAndroidBackButtonPress
as false.
Implementation
@override
final Future<bool> Function(BuildContext?)? onWillPop;