toJson method
Implementation
@override
Map<String, dynamic> toJson() {
return {
...super.toJson(),
if (strokeColor != null)
'strokeColor': Annotation._colorToHex(strokeColor),
'strokeWidth': strokeWidth ?? 1,
if (fillColor != null) 'fillColor': Annotation._colorToHex(fillColor!),
if (borderStyle != null) 'borderStyle': borderStyle!.name,
if (borderDashArray != null) 'borderDashArray': borderDashArray,
if (cloudyBorderIntensity != null)
'cloudyBorderIntensity': cloudyBorderIntensity,
if (cloudyBorderInset != null) 'cloudyBorderInset': cloudyBorderInset,
if (note != null) 'note': note, // Added to toJson
if (measurementScale != null) 'measurementScale': measurementScale,
if (measurementPrecision != null)
'measurementPrecision': measurementPrecision,
if (measurementBBox != null) 'measurementBBox': measurementBBox,
};
}