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

Navigator.of(context).push(
            MaterialPageRoute(
              settings: RouteSettings(name: "/Page1"),
              builder: (context) => Page1(),
            ),
          );

  

Navigator.of(context)
              .popUntil(ModalRoute.withName("/Page1"));

  

原文地址:https://www.cnblogs.com/wupeng88/p/13274407.html