platformViewCreatedFunction method

void platformViewCreatedFunction(
  1. int id
)

Implementation

void platformViewCreatedFunction(int id) {
  viewId = id;
  print("onPlatformViewCreated " + id.toString());
  //创建通道
  _channel = new MethodChannel('com.flutter_to_native_webview_$viewId');
  //设置监听
  nativeMessageListener();
  //加载页面
  loadUrl();
}