addDownload method
Implementation
Future<DownloadTask?> addDownload(String url, String savedDir,thead,tbody) async {
if (url.isNotEmpty) {
if (savedDir.isEmpty) {
savedDir = ".";
}
var isDirectory = await Directory(savedDir).exists();
var downloadFilename = isDirectory
? savedDir + Platform.pathSeparator + getFileNameFromUrl(url)
: savedDir;
return _addDownloadRequest(DownloadRequest(url, downloadFilename,thead,tbody));
}
}