toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'layerId': layerId.toJson(),
    'offsetX': offsetX,
    'offsetY': offsetY,
    'width': width,
    'height': height,
    'paintCount': paintCount,
    'drawsContent': drawsContent,
    if (parentLayerId != null) 'parentLayerId': parentLayerId!.toJson(),
    if (backendNodeId != null) 'backendNodeId': backendNodeId!.toJson(),
    if (transform != null) 'transform': [...?transform],
    if (anchorX != null) 'anchorX': anchorX,
    if (anchorY != null) 'anchorY': anchorY,
    if (anchorZ != null) 'anchorZ': anchorZ,
    if (invisible != null) 'invisible': invisible,
    if (scrollRects != null)
      'scrollRects': scrollRects!.map((e) => e.toJson()).toList(),
    if (stickyPositionConstraint != null)
      'stickyPositionConstraint': stickyPositionConstraint!.toJson(),
  };
}