-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
duwen
committed
Feb 14, 2019
1 parent
53821ae
commit 756ff13
Showing
24 changed files
with
318 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,7 @@ main() async { | |
// This is big file(about 200M) | ||
// var url = "http://download.dcloud.net.cn/HBuilder.9.0.2.macosx_64.dmg"; | ||
|
||
// This is a image, about 4KB | ||
//var url = "https://flutter.io/assets/flutter-lockup-4cb0ee072ab312e59784d9fbf4fb7ad42688a7fdaea1270ccf6bbf4f34b7e03f.svg"; | ||
var url = | ||
"https://cdn.jsdelivr.net/gh/flutterchina/[email protected]/docs/imgs/book.jpg"; | ||
var url = "https://cdn.jsdelivr.net/gh/flutterchina/[email protected]/docs/imgs/book.jpg"; | ||
await download1(dio, url, "./example/book1.jpg"); | ||
await download2(dio, url, "./example/book2.jpg"); | ||
} | ||
|
@@ -25,7 +22,7 @@ Future download1(Dio dio, String url, String savePath) async { | |
try { | ||
await dio.download( | ||
url, | ||
"./example/book.jpg", | ||
savePath, | ||
onReceiveProgress: showDownloadProgress, | ||
); | ||
} catch (e) { | ||
|
@@ -35,7 +32,7 @@ Future download1(Dio dio, String url, String savePath) async { | |
|
||
Future download2(Dio dio, String url, String savePath) async { | ||
try { | ||
Response response = await dio.get<List<int>>( | ||
Response response = await dio.get( | ||
url, | ||
onReceiveProgress: showDownloadProgress, | ||
//Received data with List<int> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.