Last updated:
0 purchases
simple file downloader flutter
flutter version of Simple file downloader
Features #
pure dart
support resume from breakpoint
support progress and speed callback
Getting started #
Usage #
//init
//open log , close default
FileDownloader.openLog = true;
//custom your dio . not necessary.
//FileDownloader.dio = Dio();
//default download save dir, must be set if not set filePath when download
FileDownloader.globalSaveDir = "/Users/hss/Downloads";
var url = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WeAreGoingOnBullrun.mp4";
FileDownloader(
url: url,
//filePath: "/Users/hss/Downloads/WeAreGoingOnBullrun-2.mp4",
onSuccess: (url, filePath) {
//print('下载成功: $url -> $filePath');
},
).start();
//cancel download
Future.delayed(Duration(seconds: 3)).then((value) => FileDownloader.cancel(url));
copied to clipboard
the fileDownloader support configs:
FileDownloader({
required this.url,
this.filePath,
this.forceRedownload,
this.notAcceptRanges,
this.headers = const {},
this.fileSizeAlreadyKnown,
this.onStartReal,
this.onFailed,
this.progressCallbackIntervalMills = 300,
this.retryTimes = 1,
this.tags = const {},
required this.onSuccess,
this.onProgress,
this.onCancel,
});
copied to clipboard
some case #
file already downloaded: #
reqeust started then canceled when downloading: #
resume downloading from breakpoint #
And finally download success:
a response without content-length: #
Additional information #
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.