多级页面跳转
来源:6-7 如何创建和使用Flutter的路由与导航?【边学边做】

qq_一米_11
2021-08-09
Push 和Pop是弹栈和压栈的方式进行路由管理的嘛? 如果多级连跳怎么处理? 比如1->2->3->4 我现在要直接从4回到1,应该怎么处理的?可以Pop回到指定的页面嘛?
写回答
1回答
-
CrazyCodeBoy
2021-08-10
Navigator.pushNamedAndRemoveUntil(context, '/', (_) => false);
具体可参考下:https://stackoverflow.com/questions/52048101/how-to-reset-the-base-route-in-my-flutter-app-that-is-pop-any-routes-and-repla10
相似问题