将数据从颤振传递到 webview

时间:2021-05-05 16:18:35

标签: flutter dart webview-flutter

我想将数据从flutter传递到webview

我的数据是这样定义的,

var data = {
   "id": "hweqetwyqte"
};

我在 webview 中传递如下数据,

webViewController.evaluateJavascript('''
 t._selectItem($data); // this is not working --> I want this to work
 t._selectItem({"id": "hweqetwyqte"}); // this is working
''');

任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:-1)

试试

t._selectItem({"id": "${data['id']}}"})