How to get current route path in Flutter?

后端 未结 4 1951
长情又很酷
长情又很酷 2020-12-02 10:13

While implementing persistent bottom bar, previous route need to be restored when a button in the bottom bar was clicked.

When a button in the bottom bar is clicked

4条回答
  •  既然无缘
    2020-12-02 10:37

    To get the current route name example /home or /page try this

    ModalRoute.of(context).settings.name
    

提交回复
热议问题