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

Related tags

Templates buxing
Overview

pub package Build Status

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

Features

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

Usage

Install and import this package:

import 'package:buxing/buxing.dart';

A simple task

void main() async {
  var task = Task(
      Uri.parse('https://golang.org/dl/go1.17.3.src.tar.gz'), 'go1.17.3.src.tar.gz');
  await task.start();
}

Progress reporting

Progress events are raised through Task.onProgress:

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

Multiple connections

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

var task = Task(Uri.parse('https://golang.org/dl/go1.17.3.src.tar.gz'),
    'go1.17.3.src.tar.gz',
    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

Logging

To enable logging, set the logger field:

var task = Task(Uri.parse('https://golang.org/dl/go1.17.3.src.tar.gz'),
    'downloads/go1.17.3.src.tar.gz',
    logger: Logger(level: LogLevel.info));

Log levels:

enum LogLevel { verbose, info, warning, error }
You might also like...

An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio.

network_requests An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio. Platform Supported

Dec 15, 2022

Serialize almost everything you ever need! 📦 Supports serializing MaterialColor, Color, Size, Locale, IconData, UuidValue, DateTime, Directory, File, Duration, and many more.

Serialize almost everything you ever need! 📦 Supports serializing MaterialColor, Color, Size, Locale, IconData, UuidValue, DateTime, Directory, File, Duration, and many more.

osum_serializable The goal is to serialize almost everything you ever need! json_serializable is an amazing package to serialize classes but cannot se

Sep 23, 2022

Generates a new Flutter app with http client, theme, routing and localization features.

Starter Template Generates a new Flutter app with http client, theme, routing and localization features. Brick Uses: dio as http client pretty_dio_log

Nov 3, 2022

A fully functional social media app built with flutter with multiple features

A fully functional social media app built with flutter with multiple features

🔥 🔥 Wooble Social Media App Wooble is a fully functional social media app with multiple features built with flutter and dart. Star ⭐ the repo if you

Jan 3, 2023

Kenso - A fully functional social media app with multiple features built with flutter and dart

Kenso - A fully functional social media app with multiple features built with flutter and dart

Kenso - Social Media App Kenso is a fully functional social media app with multi

Feb 8, 2022

Flutter file based routing - File based routing and nested layouts for Flutter

Flutter File Based Routing I was inspired by the routing in remix.run with neste

Sep 29, 2022

This project is a rebuild of the existing movie colony https://github.com/debbsefe/Movie-Colony. Here's also a link to the figma file https://www.figma.com/file/XpLFNEsROiN1z6lwnNHMrU/Movie-app?node-id=2956%3A10161

Tvfiy Generated by the Very Good CLI 🤖 A Very Good Project created by Very Good CLI. Getting Started 🚀 This project contains 3 flavors: development

Nov 12, 2022

Youtube video downloader made using flutter.

FluTube Youtube video downloader made using flutter. Direct app download Build from source Download latest Flutter SDK (=2.2.3) Clone this repo and t

Dec 28, 2022

dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on background

dosdownloader Dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on back

Dec 8, 2021
Comments
Owner
Liu YuanYuan
Liu YuanYuan
A powerful Http client for Dart, which supports Interceptors, FormData, Request Cancellation, File Downloading, Timeout etc.

dio_http A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File downloading, Timeout

null 46 Dec 19, 2021
A powerful Http client for Dart, which supports Interceptors, FormData, Request Cancellation, File Downloading, Timeout etc.

Language: English | 中文简体 dio A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File

Flutter中国开源项目 11.2k Jan 3, 2023
Flutter Download Manager is a Cross-Platform file downloader with Parallel and Batch Download support

Flutter Download Manager is a Cross-Platform file downloader with Parallel and Batch Download support. Manage download tasks by url and be notified of status and their progress. Pause, Cancel, Queue and Resume Downloads.

Nabil Mosharraf 11 Dec 17, 2022
Flutter plugin (android) for sharing bytes and files Offline, (Based on the android Nearby Connections API)

nearby_connections An android flutter plugin for the Nearby Connections API Currently supports Bytes and Files. Transfer Data between multiple connect

Prerak Mann 63 Nov 21, 2022
Makes it possible to safely execute and retry a Future inside a StatelessWidget

futuristic Makes it possible to safely execute and retry a Future inside a StatelessWidget. See the Mainstream package for a similar API for working w

Martin Rybak 28 Sep 15, 2022
Starter app for Flutter that includes many different production app features; some not typically included in demo apps.

first_app: Starter app for a Flutter production app Maintainer: Greger Wedel, https://github.com/gregertw Listed on: Latest build and artifacts: ** La

Greger Teigre Wedel 371 Dec 28, 2022
E-Commerce App with getx phone Authtentication and many features flutter firebase

ecommerce_app_getx A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

AdnanGriezmann 4 Oct 12, 2022
App HTTP Client is a wrapper around the HTTP library Dio to make network requests and error handling simpler, more predictable, and less verbose.

App HTTP Client App HTTP Client is a wrapper around the HTTP library Dio to make network requests and error handling simpler, more predictable, and le

Joanna May 44 Nov 1, 2022
Charlatan - A library for configuring and providing fake http responses to your dio HTTP client.

charlatan This package provides the ability to configure and return fake HTTP responses from your Dio HTTP Client. This makes it easy to test the beha

Betterment 14 Nov 28, 2022