InAppWebViewController constructor

InAppWebViewController(
  1. dynamic id,
  2. WebView webview
)

Implementation

InAppWebViewController(dynamic id, WebView webview) {
  this._id = id;
  this._channel =
      MethodChannel('com.pichillilorenzo/flutter_inappwebview_$id');
  this._channel.setMethodCallHandler(handleMethod);
  this._webview = webview;

  final initialUserScripts = webview.initialUserScripts;
  if (initialUserScripts != null) {
    for (final userScript in initialUserScripts) {
      if (userScript.injectionTime ==
          UserScriptInjectionTime.AT_DOCUMENT_START) {
        this
            ._userScripts[UserScriptInjectionTime.AT_DOCUMENT_START]
            ?.add(userScript);
      } else {
        this
            ._userScripts[UserScriptInjectionTime.AT_DOCUMENT_END]
            ?.add(userScript);
      }
    }
  }
  this._init();
}