toJson method
The declaration as DataEntityKind.fromJson reads it, leaving out what is empty.
Implementation
Map<String, Object?> toJson() => <String, Object?>{
'type': type,
if (requires.isNotEmpty) 'requires': requires,
if (collider != null) 'collider': collider!.name,
};