download static method
Future<Response?>
download(
- String url,
- String savePath,
- ProgressCallback? onReceiveProgress, {
- bool newClient = false,
下载文件
Implementation
static Future<Response<dynamic>?> download(
String url,
String savePath,
ProgressCallback? onReceiveProgress, {
bool newClient = false,
}) async {
try {
assetDio();
var client = newClient ? Dio() : _dio!;
return await client.download(
url,
savePath,
onReceiveProgress: onReceiveProgress,
);
} on DioException catch (e) {
return _convertException(e, url);
} on SocketException catch (e) {
return _convertException(e, url);
}
}