FrameInfo.fromJson constructor Null safety

FrameInfo.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory FrameInfo.fromJson(Map<String, dynamic> json) {
  return FrameInfo(
    id: FrameId.fromJson(json['id'] as String),
    parentId: json.containsKey('parentId')
        ? FrameId.fromJson(json['parentId'] as String)
        : null,
    loaderId: network.LoaderId.fromJson(json['loaderId'] as String),
    name: json.containsKey('name') ? json['name'] as String : null,
    url: json['url'] as String,
    urlFragment: json.containsKey('urlFragment')
        ? json['urlFragment'] as String
        : null,
    domainAndRegistry: json['domainAndRegistry'] as String,
    securityOrigin: json['securityOrigin'] as String,
    mimeType: json['mimeType'] as String,
    unreachableUrl: json.containsKey('unreachableUrl')
        ? json['unreachableUrl'] as String
        : null,
    adFrameStatus: json.containsKey('adFrameStatus')
        ? AdFrameStatus.fromJson(
            json['adFrameStatus'] as Map<String, dynamic>)
        : null,
    secureContextType:
        SecureContextType.fromJson(json['secureContextType'] as String),
    crossOriginIsolatedContextType: CrossOriginIsolatedContextType.fromJson(
        json['crossOriginIsolatedContextType'] as String),
    gatedAPIFeatures: (json['gatedAPIFeatures'] as List)
        .map((e) => GatedAPIFeatures.fromJson(e as String))
        .toList(),
  );
}