downloadFile method
Future
downloadFile(
- dynamic urlPath,
- dynamic savePath, [
- dynamic resultDialogConfig,
- bool isCancelWhiteList = false,
Implementation
Future downloadFile(urlPath, savePath,
[resultDialogConfig, bool isCancelWhiteList = false]) async {
Response? response;
try {
response = await dio?.download(urlPath, savePath,
onReceiveProgress: (int count, int total) {
print("$count $total");
}, cancelToken: isCancelWhiteList ? whiteListCancelToken : cancelToken);
return response?.data;
} catch (e) {
_catchOthersError(e);
} finally {
_showResultDialog(response, resultDialogConfig);
}
}