toJson method
Implementation
@override
Map<String, dynamic> toJson() {
final json = super.toJson();
json['type'] = type;
json.addAll({
'name': name ?? '',
'library': library?.toJson(),
'abstract': isAbstract ?? false,
'const': isConst ?? false,
'traceAllocations': traceAllocations ?? false,
'interfaces': interfaces?.map((f) => f.toJson()).toList(),
'fields': fields?.map((f) => f.toJson()).toList(),
'functions': functions?.map((f) => f.toJson()).toList(),
'subclasses': subclasses?.map((f) => f.toJson()).toList(),
});
_setIfNotNull(json, 'location', location?.toJson());
_setIfNotNull(json, 'typeParameters',
typeParameters?.map((f) => f.toJson()).toList());
_setIfNotNull(json, 'error', error?.toJson());
_setIfNotNull(json, 'super', superClass?.toJson());
_setIfNotNull(json, 'superType', superType?.toJson());
_setIfNotNull(json, 'mixin', mixin?.toJson());
return json;
}