toJson method
Serialises this node and all its children into the SDUI JSON format.
Implementation
@override
Map<String, dynamic> toJson() => {
'widget': _buttonType,
'properties': {
'label': label,
if (labelColor != null) 'labelColor': resolveColor(labelColor),
if (backgroundColor != null)
'backgroundColor': resolveColor(backgroundColor),
if (borderColor != null) 'borderColor': resolveColor(borderColor),
if (borderWidth != null) 'borderWidth': borderWidth,
if (borderRadius != null) 'borderRadius': borderRadius,
if (fontSize != null) 'fontSize': fontSize,
if (fontWeight != null) 'fontWeight': fontWeight,
if (padding != null) 'padding': padding,
},
if (icon != null) 'icon': icon!.toJson(),
if (onTap != null) 'onTap': onTap!.toJson(),
};