Migrate a Flutter app from WillPopScope to PopScope and onPopInvokedWithResult (Flutter 3.16 to 3.47)
WillPopScope and onPopInvoked are deprecated, and predictive back on Android 14+ ignores them. How to move each onWillPop pattern to PopScope.canPop and onPopInvokedWithResult, the confirm-dialog loop you have to guard against, the PopScope<T> type crash, and what dart fix will not do for you. Tested on Flutter 3.44.8.