jackleemeta / al_downloader_flutter

A URL-based flutter downloader that supports to download any type of file and automatically manages a lot of things.
https://github.com/jackleemeta/al_downloader_flutter
MIT License
33 stars 12 forks source link

batch download Headers support? #34

Closed rrickyzz closed 9 months ago

rrickyzz commented 1 year ago

The package is very easy to use and convenient in most cases but I am wondering if it supports headers for batch download?

jackleemeta commented 1 year ago

https://github.com/jackleemeta/al_downloader_flutter/blob/58d8c7fc0d4c6e61c603d14fe73fcddfba6da240/lib/src/ALDownloaderBatcher.dart#L47

rrickyzz commented 1 year ago

would you mind giving me a sample implementation for headers in batch download sir?

jackleemeta commented 1 year ago
    final vo1 = ALDownloaderBatcherInputVO('url1');
    vo1.headers = {'Cache-Control': 'no-cache'};

    final vo2 = ALDownloaderBatcherInputVO('url2');
    vo2.headers = {'Cache-Control': 'no-store'};

    final vo3 = ALDownloaderBatcherInputVO('url3');
    vo3.headers = {'Cache-Control': 'no-transform'};

    final vos = [vo1, vo2, vo3];

    ALDownloaderBatcher.downloadUrlsWithVOs(vos);