I'm new to flutter development, and find it a bit frustrating in iOS when you have a navigation drawer and when you swipe to open it, it'll perform a Navigation.of(context).pop()
. I would like to disable this "swipe to pop" behavior in iOS. I have been perusing the documentation, but without much luck.
I do see something referred to as a WillPopScope
which seems to do the trick (github issue for it here), but I'm not 100% sure if this is the "correct" way to do it (it seems too complicated... it should be easier... like a setting on the root app).
To disable Swipe TabBar user can by changing how the page view should respond to user input using the physics property. and we have a NeverScrollableScrollPhysics for that purpose so just change physics to that like this : You can disable swiping from TabBarView()
WillPopScope
is the correct way to do this.
(it seems too complicated... it should be easier... like a setting on the root app).
It is not complicated. It's a one liner :
WillPopScope( onWillPop: () async => false, child: <children here> )
A configuration file would make things more complicated as it's harder to read and maintain.
And remember that in flutter everything is a widget not just half of them. Authentification, configurations, everything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With