DoxResponse constructor
DoxResponse(
- dynamic _contentData
content can be anything
String, int, Map, json serializable object, Stream<List<int>>, File
Implementation
DoxResponse(this._contentData) {
if (_contentData is StreamFile) {
_contentType = _contentData.contentType;
}
dynamic data = _contentData;
if (data is DownloadableFile) {
header(FILE_DOWNLOAD_HEADER, data.contentDisposition);
_contentType = data.contentType;
_contentData = StreamFile(
data.contentType,
data.stream,
length: data.length,
);
}
}