fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
https://pub.dev/packages/flutter_webview_plugin
Other
1.48k stars 929 forks source link

The iOS and Android execution returns are inconsistent #968

Open BrinedFish0222 opened 8 months ago

BrinedFish0222 commented 8 months ago

flutter version: 3.7.7 flutter_webview_plugin version: 0.4.0

my code:

final flutterWebviewPlugin = FlutterWebviewPlugin();
var js = "var jsonRes = {\"abc\": 1, \"array1\": [1, 2, 3]};jsonRes";
await flutterWebviewPlugin.launch("about:blank", withJavascript: true, hidden: true);
String? javascriptResult = await flutterWebviewPlugin.evalJavascript(js) ?? '';

Android returned the correct result iOS result:{ abc = 1; array1 = ( 1, 2, 3 ); }

What's going on here? Can you help me, please