simple_file_downloader_dart 1.0.3 copy "simple_file_downloader_dart: ^1.0.3" to clipboard
simple_file_downloader_dart: ^1.0.3 copied to clipboard

a simple file downloader by dio, support resume from breakpoint

example/simple_file_downloader_dart_example.dart

import 'package:simple_file_downloader_dart/simple_file_downloader_dart.dart';

void main() {
  //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";
  var url = "https://background-business-biz-service-test.oss-cn-hongkong.aliyuncs.com/other/ec79ac786e0a4611afda838510d4fe69116461.pdf"
      "?Expires=1728716365&OSSAccessKeyId=LTAI4Fg2iUt3nkSrCM2DfiXW&Signature=mKYoz9nLoWufaBpglc68xSI9DgM%3D";

  //response without content-length
  //var url = "http://www.httpwatch.com/httpgallery/chunked/chunkedimage.aspx?0.04400023248109086";
  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));
}
3
likes
0
points
34
downloads

Publisher

verified publisherhss01248.tech

Weekly Downloads

a simple file downloader by dio, support resume from breakpoint

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio

More

Packages that depend on simple_file_downloader_dart