NodeTreeSnapshot.fromJson constructor

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

Implementation

factory NodeTreeSnapshot.fromJson(Map<String, dynamic> json) {
  return NodeTreeSnapshot(
    parentIndex: json.containsKey('parentIndex')
        ? (json['parentIndex'] as List).map((e) => e as int).toList()
        : null,
    nodeType: json.containsKey('nodeType')
        ? (json['nodeType'] as List).map((e) => e as int).toList()
        : null,
    shadowRootType: json.containsKey('shadowRootType')
        ? RareStringData.fromJson(
            json['shadowRootType'] as Map<String, dynamic>)
        : null,
    nodeName: json.containsKey('nodeName')
        ? (json['nodeName'] as List)
            .map((e) => StringIndex.fromJson(e as int))
            .toList()
        : null,
    nodeValue: json.containsKey('nodeValue')
        ? (json['nodeValue'] as List)
            .map((e) => StringIndex.fromJson(e as int))
            .toList()
        : null,
    backendNodeId: json.containsKey('backendNodeId')
        ? (json['backendNodeId'] as List)
            .map((e) => dom.BackendNodeId.fromJson(e as int))
            .toList()
        : null,
    attributes: json.containsKey('attributes')
        ? (json['attributes'] as List)
            .map((e) => ArrayOfStrings.fromJson(e as List))
            .toList()
        : null,
    textValue: json.containsKey('textValue')
        ? RareStringData.fromJson(json['textValue'] as Map<String, dynamic>)
        : null,
    inputValue: json.containsKey('inputValue')
        ? RareStringData.fromJson(json['inputValue'] as Map<String, dynamic>)
        : null,
    inputChecked: json.containsKey('inputChecked')
        ? RareBooleanData.fromJson(
            json['inputChecked'] as Map<String, dynamic>)
        : null,
    optionSelected: json.containsKey('optionSelected')
        ? RareBooleanData.fromJson(
            json['optionSelected'] as Map<String, dynamic>)
        : null,
    contentDocumentIndex: json.containsKey('contentDocumentIndex')
        ? RareIntegerData.fromJson(
            json['contentDocumentIndex'] as Map<String, dynamic>)
        : null,
    pseudoType: json.containsKey('pseudoType')
        ? RareStringData.fromJson(json['pseudoType'] as Map<String, dynamic>)
        : null,
    pseudoIdentifier: json.containsKey('pseudoIdentifier')
        ? RareStringData.fromJson(
            json['pseudoIdentifier'] as Map<String, dynamic>)
        : null,
    isClickable: json.containsKey('isClickable')
        ? RareBooleanData.fromJson(
            json['isClickable'] as Map<String, dynamic>)
        : null,
    currentSourceURL: json.containsKey('currentSourceURL')
        ? RareStringData.fromJson(
            json['currentSourceURL'] as Map<String, dynamic>)
        : null,
    originURL: json.containsKey('originURL')
        ? RareStringData.fromJson(json['originURL'] as Map<String, dynamic>)
        : null,
  );
}