toJson method
Convert the type ref to its JSON representation.
Implementation
Map<String, dynamic> toJson() => {
if (cacheId != null)
'id': cacheId!
else if (spec != null)
'unresolved': spec!.toJson()
else
'ref': ref!,
'typeArgs': [for (final t in typeArgs) t.toJson()]
};