```dart
import 'dart:js' as js;
void postMessage(String channel, String msg) {
final messageHandlers = js.context["webkit"]?["messageHandlers"];
dynamic channelObject;
if (messageHandlers != null) {
// js.context.callMethod("postMessage", []);
channelObject = messageHandlers[channel];
} else {
channelObject = js.context[channel];
}
// logcat("channel: $channel $channelObject");
channelObject?.callMethod("postMessage", [msg]);
}
```
FlutterWeb 和 WebView 原生交互调用FlutterWeb 和 WebView 原生交互调用 需要创建两个工程,一个是FlutterWeb工程最终打包成Web页面,一个是Flutter原生工程承载一个WebVie...