toJson method
Implementation
@override
Map<String, dynamic> toJson() {
return {
'path': path.map((p) => p.toJson()).toList(),
if (style != null) 'style': style!.value,
if (radius != null) 'radius': kIsWeb ? radius : jsonEncode(radius),
if (fillColor != null)
'fillColor': kIsWeb ? fillColor : jsonEncode(fillColor),
if (fillOpacity != null)
'fillOpacity': kIsWeb ? fillOpacity : jsonEncode(fillOpacity),
if (strokeColor != null)
'strokeColor': kIsWeb ? strokeColor : jsonEncode(strokeColor),
if (strokeStyle != null) 'strokeStyle': strokeStyle!.value,
if (strokeWeight != null)
'strokeWeight': kIsWeb ? strokeWeight : jsonEncode(strokeWeight),
if (strokeOpacity != null)
'strokeOpacity': kIsWeb ? strokeOpacity : jsonEncode(strokeOpacity),
if (anchor != null) 'anchor': anchor!.toJson(),
};
}