toJson method

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

Implementation

@override
Map<String, dynamic> toJson() => <String, Object?>{
      ...super.toJson(),
      'type': type,
      'kind': kind ?? '',
      'identityHashCode': identityHashCode ?? -1,
      'class': classRef?.toJson(),
      if (valueAsString case final valueAsStringValue?)
        'valueAsString': valueAsStringValue,
      if (valueAsStringIsTruncated case final valueAsStringIsTruncatedValue?)
        'valueAsStringIsTruncated': valueAsStringIsTruncatedValue,
      if (length case final lengthValue?) 'length': lengthValue,
      if (name case final nameValue?) 'name': nameValue,
      if (typeClass?.toJson() case final typeClassValue?)
        'typeClass': typeClassValue,
      if (parameterizedClass?.toJson() case final parameterizedClassValue?)
        'parameterizedClass': parameterizedClassValue,
      if (returnType?.toJson() case final returnTypeValue?)
        'returnType': returnTypeValue,
      if (parameters?.map((f) => f.toJson()).toList()
          case final parametersValue?)
        'parameters': parametersValue,
      if (typeParameters?.map((f) => f.toJson()).toList()
          case final typeParametersValue?)
        'typeParameters': typeParametersValue,
      if (pattern?.toJson() case final patternValue?) 'pattern': patternValue,
      if (closureFunction?.toJson() case final closureFunctionValue?)
        'closureFunction': closureFunctionValue,
      if (closureContext?.toJson() case final closureContextValue?)
        'closureContext': closureContextValue,
      if (closureReceiver?.toJson() case final closureReceiverValue?)
        'closureReceiver': closureReceiverValue,
      if (portId case final portIdValue?) 'portId': portIdValue,
      if (allocationLocation?.toJson() case final allocationLocationValue?)
        'allocationLocation': allocationLocationValue,
      if (debugName case final debugNameValue?) 'debugName': debugNameValue,
      if (label case final labelValue?) 'label': labelValue,
    };