Created
July 4, 2024 07:22
-
-
Save sohailmahmud/7630f5e2d73887bbe69763ddd74c67ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code before migration: | |
WillPopScope( | |
onWillPop: () async { | |
_myHandleOnPopMethod(); | |
return true; | |
}, | |
child: ... | |
), | |
Code after migration: | |
PopScope( | |
canPop: true, | |
onPopInvoked: (bool didPop) { | |
_myHandleOnPopMethod(); | |
}, | |
child: ... | |
), | |
Example: | |
PopScope( | |
canPop: false, | |
onPopInvoked:(bool didPop) async{ | |
if (didPop){return;} | |
controller.onPopScope(); | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment