toJson method
Implementation
@override
Map<String, dynamic> toJson() {
return {
...super.toJson(),
'rects': rects,
if (fillColor != null) 'fillColor': Annotation._colorToHex(fillColor!),
if (overlayText != null) 'overlayText': overlayText,
if (fontSize != null) 'fontSize': fontSize,
if (fontColor != null) 'fontColor': Annotation._colorToHex(fontColor!),
if (repeat != null) 'repeat': repeat,
if (outlineColor != null)
'outlineColor': Annotation._colorToHex(outlineColor!),
if (repeatOverlayText != null) 'repeatOverlayText': repeatOverlayText,
'rotation': rotation,
};
}