-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
In our case, we want to present confirmation dialogs when the user wants to close the page and WillPopScope works like a charm in this scenario.
Yes, we can set canPop: false and write dialogue prompting logic inside onPopInvoked, but it doesn't solve the problem because the result of NavigatorState.maybePop will be returned before the user answers to dialog.
Also, popDisposition is sync, while willPop is async. This makes prompting a dialogue impossible.
Proposal
Is there any chance the decision about deprecating WillPopScope will be revisited?
My team finds PopScope inconvenient in comparison to WillPopScope.
While WillPopScope allows to intercept the pop-action intent, the PopScope doesn't. Instead, PopScope proposes to handle the result of this action.
UPD:
We have worked around this by writing a custom maybePop method.
But I still think WillPopScope can live together with PopScope