toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'nodeType': nodeType,
    'nodeName': nodeName,
    'nodeValue': nodeValue,
    'backendNodeId': backendNodeId.toJson(),
    if (textValue != null) 'textValue': textValue,
    if (inputValue != null) 'inputValue': inputValue,
    if (inputChecked != null) 'inputChecked': inputChecked,
    if (optionSelected != null) 'optionSelected': optionSelected,
    if (childNodeIndexes != null) 'childNodeIndexes': [...?childNodeIndexes],
    if (attributes != null)
      'attributes': attributes!.map((e) => e.toJson()).toList(),
    if (pseudoElementIndexes != null)
      'pseudoElementIndexes': [...?pseudoElementIndexes],
    if (layoutNodeIndex != null) 'layoutNodeIndex': layoutNodeIndex,
    if (documentURL != null) 'documentURL': documentURL,
    if (baseURL != null) 'baseURL': baseURL,
    if (contentLanguage != null) 'contentLanguage': contentLanguage,
    if (documentEncoding != null) 'documentEncoding': documentEncoding,
    if (publicId != null) 'publicId': publicId,
    if (systemId != null) 'systemId': systemId,
    if (frameId != null) 'frameId': frameId!.toJson(),
    if (contentDocumentIndex != null)
      'contentDocumentIndex': contentDocumentIndex,
    if (pseudoType != null) 'pseudoType': pseudoType!.toJson(),
    if (shadowRootType != null) 'shadowRootType': shadowRootType!.toJson(),
    if (isClickable != null) 'isClickable': isClickable,
    if (eventListeners != null)
      'eventListeners': eventListeners!.map((e) => e.toJson()).toList(),
    if (currentSourceURL != null) 'currentSourceURL': currentSourceURL,
    if (originURL != null) 'originURL': originURL,
    if (scrollOffsetX != null) 'scrollOffsetX': scrollOffsetX,
    if (scrollOffsetY != null) 'scrollOffsetY': scrollOffsetY,
  };
}