toJson method
Implementation
Map<String, Object?> toJson() => {
'kind': kind,
if (visibility != GizmoVisibility.always) 'visibility': visibility.name,
if (color != null) 'color': color!.toJson(),
if (!xray) 'xray': false,
if (when != null) 'when': when!.toJson(),
...fieldsToJson(),
};