pub package Build Status

An HTTP file downloader packed with many features -> resumable downloads, multiple connections, buffering, auto-retry, etc.


  • Resumable downloads.
  • Supports multiple connections.
  • Auto buffering for less disk writes.
  • Auto HTTP connection retry via the builtin RetryClient.


Install and import this package:

import 'package:buxing/buxing.dart';

A simple task

void main() async {
  var task = Task(
      Uri.parse(''), 'go1.17.3.src.tar.gz');
  await task.start();

Progress reporting

Progress events are raised through Task.onProgress:

task.onProgress = (prog) => print(prog.transferred /;

Multiple connections

To enable multiple connections, set the optional worker param in constructor and pass a ParallelWorker.

var task = Task(Uri.parse(''),
    worker: ParallelWorker()); // A `ParallelWorker` enables multiple connections.

By default ParallelWorker manages concurrency by itself, you can explicitly set the number of concurrent connections:

ParallelWorker(concurrency: 10)

Buffer size

The defaults are, 200 KB for a single-connection task, 50 KB per connection for a multi-connection task.

To set the buffer size:

// Single-connection task
var task = Task(Uri.parse('URL'), 'FILE',
    worker: Worker(bufferSize: 100000)); // 100 KB

// Multi-connection task.
var task = Task(Uri.parse('URL'), 'FILE',
    worker: ParallelWorker(bufferSize: 100000)); // 100 KB


To enable logging, set the logger field:

var task = Task(Uri.parse(''),
    logger: Logger(level:;

Log levels:

enum LogLevel { verbose, info, warning, error }