Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sohailmahmud/7630f5e2d73887bbe69763ddd74c67ad to your computer and use it in GitHub Desktop.
Save sohailmahmud/7630f5e2d73887bbe69763ddd74c67ad to your computer and use it in GitHub Desktop.
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