toJson method
Convert this data type instance to a JSON object.
Implementation
@override
Map<String, dynamic> toJson() {
return {
'type': 'struct',
'fields': {for (final entry in fields.entries) entry.key: entry.value.toJson()},
...super.toJson(),
};
}