Flutter 跳转并关闭所有或当前页面

///跳转到起始页并关闭所有页面
Navigator.pushAndRemoveUntil(
      context,
      new MaterialPageRoute(builder: (context) => new Splash()),
          (Route<dynamic> route) => false,
    );
    ///或者
Navigator.pushAndRemoveUntil(
          context,
          new MaterialPageRoute(builder: (context) => new Home()),
              (route) => route == null);

A——B——C C返回到A

Navigator.of(context).pushReplacement(
            MaterialPageRoute(builder: (context)=>Share3())
        );
相关推荐
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页