Search packages, repositories and app categories

Package detailsv0.4.1

dtorrent_task

BitTorrent download client package written by pure Dart language.

AndroidiOSmacOSWindowsLinux
30-day downloads
216
Likes
22
Pub points
130

Install package

flutter pub add dtorrent_task

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A BitTorrent download client implemented entirely in Dart, enabling cross-platform torrent downloads without native code. It supports core BitTorrent functionality such as seeding, downloading, and managing torrent files. Built for developers seeking lightweight, pure-Dart solutions for file sharing and peer-to-peer transfers across Android, iOS, macOS, Windows, and Linux. The package is ideal for integrating torrent capabilities into Flutter apps with minimal dependencies.

Use cases

  • Integrating torrent downloads into Flutter apps
  • Building P2P file-sharing applications
  • Automating file transfers via BitTorrent
  • Creating offline content distribution tools
  • Developing cross-platform download managers

Key features

  • Pure Dart implementation
  • Cross-platform support (Android, iOS, macOS, Windows, Linux)
  • Lightweight and dependency-free
  • Supports torrent file parsing and download management
  • Built-in event-driven architecture for tracking download progress

Suitable for

  • Flutter developers building P2P features
  • Apps requiring offline or decentralized file transfer
  • Projects avoiding native platform-specific code
  • Educational projects exploring BitTorrent protocol
  • Tools needing lightweight torrent client integration

Considerations

  • Limited to basic BitTorrent functionality (no advanced features like encryption or port forwarding)
  • Performance may vary on low-end devices due to pure Dart execution
  • No built-in UI components—requires custom interface development
  • Depends on external trackers and peers for content availability
  • Not suitable for high-volume or enterprise-grade torrent operations

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

About

Dart library for implementing BitTorrent client.

codecov

Whole Dart Torrent client contains serival parts :

This package implements regular BitTorrent Protocol and manage above packages to work together for downloading.

BEP Support:

  • [BEP 0003 The BitTorrent Protocol Specification]
  • [BEP 0005 DHT Protocal]
  • [BEP 0006 Fast Extension]
  • [BEP 0010 Extension Protocol]
  • [BEP 0011 Peer Exchange (PEX)]
  • [BEP 0014 Local Service Discovery]
  • [BEP 0015 UDP Tracker Protocal]
  • [BEP 0029 uTorrent transport protocol]
  • [BEP 0055 Holepunch extension]

Developing:

  • [BEP 0009 Extension for Peers to Send Metadata Files]

Other support will come soon.

How to use

This package need to dependency dtorrent_parser:

dependencies:
  dtorrent_parser : ^1.0.4
  dtorrent_task : '>= 0.2.1 < 2.0.0'

First , create a Torrent model via .torrent file:

  var model = await Torrent.parse('some.torrent');

Second, create a Torrent Task and start it:

  var task = TorrentTask.newTask(model,'savepath');
  task.start();

User can add some listener to monitor TorrentTask running:

  task.onTaskComplete(() => .....);
  task.onFileComplete((String filePath) => .....);

and there is some method to control the TorrentTask:

   // Stop task:
   task.stop();
   // Pause task:
   task.pause();
   // Resume task:
   task.resume();

Testing

Run tests:

dart test

Run tests with coverage:

dart test --coverage=coverage
dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.dart_tool/package_config.json --report-on=lib

Or use the provided script:

dart tool/coverage.dart

The coverage report will be generated at coverage/lcov.info and can be viewed with tools like genhtml or uploaded to services like Codecov.

Coverage is automatically uploaded to Codecov on every push and pull request via GitHub Actions.

Categories

Dependencies

Dependency list 13 items

  • args^2.4.2
  • b_encode_decode^1.0.5
  • bittorrent_dht^0.0.14
  • collection^1.0.0
  • crypto^3.0.3
  • dart_ipify^1.1.1
  • dtorrent_common^1.0.8
  • dtorrent_parser^1.0.9
  • dtorrent_tracker^1.3.20
  • events_emitter2^1.0.3
  • logging^1.2.0
  • mime^1.0.4
  • utp_protocol^1.0.5

Source repository

Projects using this package

No data available yet.