toJson method
Implementation
@override
Map<String, dynamic> toJson() => {
'id': id,
'type': type,
'url': serializeColorOrValue(url),
if (altText != null) 'altText': altText,
if (fit != null) 'fit': fit,
if (width != null) 'width': width,
if (height != null) 'height': height,
if (borderRadius != null) 'borderRadius': borderRadius,
if (padding != null) 'padding': serializePadding(padding),
};