AXNodeData.fromJson constructor

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

Implementation

factory AXNodeData.fromJson(Map<String, dynamic> json) {
  return AXNodeData(
    nodeId: AXNodeId.fromJson(json['nodeId'] as String),
    ignored: json['ignored'] as bool? ?? false,
    ignoredReasons: json.containsKey('ignoredReasons')
        ? (json['ignoredReasons'] as List)
            .map((e) => AXProperty.fromJson(e as Map<String, dynamic>))
            .toList()
        : null,
    role: json.containsKey('role')
        ? AXValue.fromJson(json['role'] as Map<String, dynamic>)
        : null,
    chromeRole: json.containsKey('chromeRole')
        ? AXValue.fromJson(json['chromeRole'] as Map<String, dynamic>)
        : null,
    name: json.containsKey('name')
        ? AXValue.fromJson(json['name'] as Map<String, dynamic>)
        : null,
    description: json.containsKey('description')
        ? AXValue.fromJson(json['description'] as Map<String, dynamic>)
        : null,
    value: json.containsKey('value')
        ? AXValue.fromJson(json['value'] as Map<String, dynamic>)
        : null,
    properties: json.containsKey('properties')
        ? (json['properties'] as List)
            .map((e) => AXProperty.fromJson(e as Map<String, dynamic>))
            .toList()
        : null,
    parentId: json.containsKey('parentId')
        ? AXNodeId.fromJson(json['parentId'] as String)
        : null,
    childIds: json.containsKey('childIds')
        ? (json['childIds'] as List)
            .map((e) => AXNodeId.fromJson(e as String))
            .toList()
        : null,
    backendDOMNodeId: json.containsKey('backendDOMNodeId')
        ? dom.BackendNodeId.fromJson(json['backendDOMNodeId'] as int)
        : null,
    frameId: json.containsKey('frameId')
        ? page.FrameId.fromJson(json['frameId'] as String)
        : null,
  );
}