dloader 1.2.5 dloader: ^1.2.5 copied to clipboard
A simple and versatile library for downloading files with support for adapters including dio, curl, wget, powershell, aria2 and axel. Feel free to create new adapters.
import 'dart:io';
import 'package:dloader/dloader.dart';
void main() {
final dloader = Dloader(DioAdapter());
final url = 'https://example.com/file.zip';
final destination = File('/home/helio/file.zip');
dloader
.download(
url: url,
destination: destination,
onProgress: (progress) {
print('Percent complete: ${progress['percentComplete']}%');
})
.then((File file) {
print('File downloaded to: ${file.path}');
}).catchError((e) {
print('Error downloading file: $e');
});
}