fetchMultiple function
Fetches the list of of resources indicated by urls
;
The list of resources will be downloaded in parallel.
var urls = <FetchUrl>[FetchUrl('https://some/resource/file.zip', saveToPath: '/tmp/file.zip')
, 'https://some/resource/file2.zip', saveToPath: '/tmp/file2.zip'];
fetch(url: urls);
The passed urls
must be a http or https based resource.
The FetchUrl.saveToPath contained in each FetchUrl may be an absolute (recommended) or relative path where to save the downloaded resource.
You may optionally passing in a FetchUrl.progress method with each FetchUrl which will be called each time a chunk is downloaded with details on the download progress.
We guarentee that you will recieve a final event with the FetchProgress.progress containing a value of 1.0 and a status of 'complete' for each url requested.
You can cancel the download part way through the download by returning false to the FetchUrl.progress call.
You must call cancel on all downloads or the remaining downloads must complete before fetchMultiple will return.
Implementation
void fetchMultiple({required List<FetchUrl> urls}) =>
_Fetch().fetchMultiple(urls: urls);