flutter 返回某页面并销毁俩个页面之间的页面

2020-08-24  本文已影响0人  Smallwolf_JS

直接上代码

Navigator.of(context).push( MaterialPageRoute(
              settings: RouteSettings(name: "/routeName"),
              builder: (context) => YourPage(参数 可为空),
           ),
);

这里是返回的代码

Navigator.of(context).popUntil(ModalRoute.withName("/routeName"));
上一篇 下一篇

猜你喜欢

热点阅读