fromMap static method

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

Implementation

static AndroidChromeCustomTabsOptions fromMap(Map<String, dynamic> map) {
  AndroidChromeCustomTabsOptions options =
      new AndroidChromeCustomTabsOptions();
  // ignore: deprecated_member_use_from_same_package
  options.addDefaultShareMenuItem = map["addDefaultShareMenuItem"];
  options.shareState = map["shareState"];
  options.showTitle = map["showTitle"];
  options.toolbarBackgroundColor =
      UtilColor.fromHex(map["toolbarBackgroundColor"]);
  options.enableUrlBarHiding = map["enableUrlBarHiding"];
  options.instantAppsEnabled = map["instantAppsEnabled"];
  options.packageName = map["packageName"];
  options.keepAliveEnabled = map["keepAliveEnabled"];
  options.isSingleInstance = map["isSingleInstance"];
  options.noHistory = map["noHistory"];
  options.isTrustedWebActivity = map["isTrustedWebActivity"];
  options.additionalTrustedOrigins = map["additionalTrustedOrigins"];
  switch (map["displayMode"]["type"]) {
    case "IMMERSIVE_MODE":
      options.displayMode =
          TrustedWebActivityImmersiveDisplayMode.fromMap(map["displayMode"]);
      break;
    case "DEFAULT_MODE":
    default:
      options.displayMode = TrustedWebActivityDefaultDisplayMode();
      break;
  }
  options.screenOrientation = map["screenOrientation"];
  return options;
}