toJson method
Converts this object to a JSON-friendly map.
Implementation
@override
Map<String, Object?> toJson() => {
'type': type,
if (id != null) 'id': id,
if (name != null) 'name': name,
'paint': paint.toJson(),
'rotation': rotation,
'locked': locked,
'hidden': hidden,
'src': src,
'x': x,
'y': y,
'width': width,
'height': height,
if (crossOrigin != null) 'crossOrigin': crossOrigin,
};