Navigator的使用:

1.路由直接跳转到下一个页面:ui

Navigator.pushNamed(context,"/login");spa

2.跳转的下一个页面,替换当前的页面:路由

Navigator.of(context).pushReplacementNamed('/registerSecond');route

3.返回上一个页面:vi

Navigator.of(context).pop();co

4.清空堆栈路由,返回指定的路由:build

Navigator.of(context).pushAndRemoveUntil(push

  new MaterialPageRouter(builder:(context)=>new Tabs()),background

  (route)=>route==nullnew

);

好文推荐:https://www.jianshu.com/p/44650be76110

相关文章
相关标签/搜索