alibaba / fish-redux

An assembled flutter application framework.
https://github.com/alibaba/fish-redux
Apache License 2.0
7.33k stars 843 forks source link

利用 fish_redux 的 PageRoutes 使用 popUntil 返回到指定的页面无法使用 #477

Open sanshilei168 opened 5 years ago

zjuwjf commented 5 years ago

有具体代码么?

sanshilei168 commented 5 years ago

有具体代码么?

利用 pageRoutes 路由 进行页面的跳转 从 A —> B —> C —> D —> E 然后想要从 E处理过数据后直接返回到B 利用Navigator.popUntil(context, ModalRoute.withName('/B'));

owoeo commented 5 years ago

onGenerateRoute return MaterialPageRoute的时候,加上settings参数 例如

onGenerateRoute: (RouteSettings settings) {
      return MaterialPageRoute<Object>(
          builder: (BuildContext context) {
            return routes.buildPage(settings.name, settings.arguments);
          },
          settings: settings);
    }
Navigator.of(ctx.context)
          .popUntil((route) => route.settings?.name == '/B');