How to push multiple routes with Flutter Navigator

前端 未结 2 2105
时光取名叫无心
时光取名叫无心 2021-02-19 09:02

If I push a route in flutter to a deep part of my app is there any way to supply additional routes so that the back/up navigation can be customized?

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-19 10:02

    You can call Navigator.push() several times in a row; the routes underneath the top one will not visibly transition but they'll be hiding underneath. (Edit: Turns out this isn't true, at least on iOS, see issue 12146)

    Note that you can also alter routes below the top route using methods of NavigatorState, such as removeRouteBelow and replaceRouteBelow. This is useful for building non-linear navigation experiences.

提交回复
热议问题