Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过路由传递的参数,怎么接收 #78

Closed
Aries233 opened this issue Mar 16, 2019 · 2 comments
Closed

通过路由传递的参数,怎么接收 #78

Aries233 opened this issue Mar 16, 2019 · 2 comments

Comments

@Aries233
Copy link

fish-redux中 通过路由传递的参数,怎么在页面中接受使用呢?

Navigator.pushNamed(ctx.context, '/orderDetials',
arguments: {'orderId': action.payload});

@Aries233 Aries233 reopened this Mar 16, 2019
@zjuwjf
Copy link
Contributor

zjuwjf commented Mar 16, 2019

可以参考 #60

@Aries233
Copy link
Author

Aries233 commented Mar 16, 2019

`

  onGenerateRoute: (RouteSettings settings) {
      WidgetBuilder builder;
      if (settings.name == '/orderDetials') {
        builder = (ctx) => OrderdetailsPage().buildPage(settings.arguments);
      }
      return new MaterialPageRoute(builder: builder, settings: settings);
    }

`
已经解决了,通过在MaterialApp 配置onGenerateRoute,然后设置 .buildPage(参数)就可以。 这里的路由‘/orderDetials’名称,不需要在routes里面注册

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants