toJson method Null safety
override
Implementation
@override
Map<String, dynamic> toJson() {
final json = super.toJson();
json['type'] = type;
json.addAll({
'name': name,
'types': types?.map((f) => f.toJson()).toList(),
});
return json;
}