Flutter: Disable Swipe to Navigate Back in iOS

后端 未结 7 1105
一向
一向 2020-12-16 15:25

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(c

7条回答
  •  一整个雨季
    2020-12-16 16:04

    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: 
    )
    

    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.

提交回复
热议问题