fromMap static method

InAppWebViewOptions fromMap(
  1. Map<String, dynamic> map
)
override

Implementation

static InAppWebViewOptions fromMap(Map<String, dynamic> map) {
  List<ContentBlocker> contentBlockers = [];
  List<dynamic>? contentBlockersMapList = map["contentBlockers"];
  if (contentBlockersMapList != null) {
    contentBlockersMapList.forEach((contentBlocker) {
      contentBlockers.add(ContentBlocker.fromMap(
          Map<String, Map<String, dynamic>>.from(
              Map<String, dynamic>.from(contentBlocker))));
    });
  }

  var instance = InAppWebViewOptions();
  instance.useShouldOverrideUrlLoading = map["useShouldOverrideUrlLoading"];
  instance.useOnLoadResource = map["useOnLoadResource"];
  instance.useOnDownloadStart = map["useOnDownloadStart"];
  instance.clearCache = map["clearCache"];
  instance.userAgent = map["userAgent"];
  instance.applicationNameForUserAgent = map["applicationNameForUserAgent"];
  instance.javaScriptEnabled = map["javaScriptEnabled"];
  instance.javaScriptCanOpenWindowsAutomatically =
      map["javaScriptCanOpenWindowsAutomatically"];
  instance.mediaPlaybackRequiresUserGesture =
      map["mediaPlaybackRequiresUserGesture"];
  instance.verticalScrollBarEnabled = map["verticalScrollBarEnabled"];
  instance.horizontalScrollBarEnabled = map["horizontalScrollBarEnabled"];
  instance.resourceCustomSchemes =
      List<String>.from(map["resourceCustomSchemes"] ?? []);
  instance.contentBlockers = contentBlockers;
  instance.preferredContentMode =
      UserPreferredContentMode.fromNativeValue(map["preferredContentMode"]);
  instance.useShouldInterceptAjaxRequest =
      map["useShouldInterceptAjaxRequest"];
  instance.useShouldInterceptFetchRequest =
      map["useShouldInterceptFetchRequest"];
  instance.incognito = map["incognito"];
  instance.cacheEnabled = map["cacheEnabled"];
  instance.transparentBackground = map["transparentBackground"];
  instance.disableVerticalScroll = map["disableVerticalScroll"];
  instance.disableHorizontalScroll = map["disableHorizontalScroll"];
  instance.disableContextMenu = map["disableContextMenu"];
  instance.supportZoom = map["supportZoom"];
  instance.allowFileAccessFromFileURLs = map["allowFileAccessFromFileURLs"];
  instance.allowUniversalAccessFromFileURLs =
      map["allowUniversalAccessFromFileURLs"];
  return instance;
}