toJson method

  1. @override
Map<String, dynamic> toJson()
override

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,
    'isSealed': isSealed ?? false,
    'isMixinClass': isMixinClass ?? false,
    'isBaseClass': isBaseClass ?? false,
    'isInterfaceClass': isInterfaceClass ?? false,
    'isFinal': isFinal ?? 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;
}