Want to disable Swipe to Navigate Back in iOS in flutter? I was just solving this problem, but I also needed my user to be able to go back by pressing the “native” back button on the AppBar (did not want to reimplement AppBar just because of this), and I found this niche little flag:
1 2 3 4 5 6 | onWillPop: () async { if (Navigator.of(context).userGestureInProgress) return false; else return true; }, |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.