How to reset the base route in my Flutter App - that is pop any routes and replace it with a new one using Navigator

后端 未结 3 1871
予麋鹿
予麋鹿 2021-02-07 13:00

New to Flutter to please forgive me if this is obvious, but I have read the documentation and tried a bunch of the Navigator options but none of them work as I would like. The

3条回答
  •  终归单人心
    2021-02-07 13:43

    The good news is now we can use pushReplacementNamed

    Navigator.pushReplacementNamed(context, '/');
    

    (Channel master, v1.15.4-pre.97, I'm not sure the previous version can do that)

提交回复
热议问题