toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'type': type.name,
if (bytes != null) 'bytes': bytes,
if (url != null) 'url': url,
if (filePath != null) 'filePath': filePath,
if (mimeType != null) 'mimeType': mimeType,
if (name != null) 'name': name,
};
}