toJson method
Implementation
@override
Map<String, dynamic> toJson() {
final resource = <String, dynamic>{
'uri': uri,
};
if (text != null) resource['text'] = text!;
if (blob != null) resource['blob'] = blob!;
if (mimeType != null) resource['mimeType'] = mimeType!;
final json = <String, dynamic>{
'type': 'resource',
'resource': resource,
};
if (annotations != null) json['annotations'] = annotations!;
return json;
}