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 1854
予麋鹿
予麋鹿 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:29

    Navigator expose more than just pop. You can do things such as the following:

    Navigator.pushNamedAndRemoveUntil(context, '/', (_) => false);
    

    This will basically push a home and remove all the routes behind the new one

提交回复
热议问题