Fish Redux Navigator 参数传递
2020-05-15 本文已影响0人
DerekTime
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;
}