toJson method
Implementation
Map<String, Object?> toJson() => {
'catalog': catalog,
'key': key,
if (values.isNotEmpty) 'values': values,
if (representative case var shot?) 'representative': shot.toJson(),
if (occurrences.isNotEmpty)
'occurrences': [for (var shot in occurrences) shot.toJson()],
if (maxLength case var maxLength?) 'maxLength': maxLength.toJson(),
};