美文网首页
Fish Redux Navigator 参数传递

Fish Redux Navigator 参数传递

作者: DerekTime | 来源:发表于2020-05-15 11:38 被阅读0次
void _onShowWebView(Action action, Context<LoginState> ctx){
  String url = "https://www.baidu.com";
  String title = "WebView";

  Navigator.of(ctx.context).pushNamed('web_page',arguments: <String, String>{
    'url': url,
    'title': title,
  });
}

在XXWebViewPage 中的state.dart 中的initState方法中可以获取到传递数据

XXWebViewState initState(Map<String, dynamic> args) {
  XXWebViewState state = XXWebViewState();
  state.url = args["url"];
  state.title = args["title"];
  return state;
}

相关文章

网友评论

      本文标题:Fish Redux Navigator 参数传递

      本文链接:https://www.haomeiwen.com/subject/mtxcohtx.html