搜索插件、代码仓与 APP 分类

插件详情v0.4.1

dtorrent_task

用纯Dart语言编写的BitTorrent下载客户端包。

AndroidiOSmacOSWindowsLinux
近 30 天下载
216
喜欢数
22
Pub 分数
130

安装插件

flutter pub add dtorrent_task

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个完全用Dart实现的BitTorrent下载客户端,可在无需原生代码的情况下跨平台下载torrent。它支持核心BitTorrent功能,如种子、下载和管理torrent文件。专为寻求轻量级纯Dart解决方案以在Android、iOS、macOS、Windows和Linux上进行文件共享和点对点传输的开发者设计。该包非常适合将torrent功能集成到Flutter应用中,且依赖项极少。

适合场景

  • 将 torrent 下载集成到 Flutter 应用中
  • 构建点对点文件共享应用程序
  • 通过BitTorrent自动传输文件
  • 创建离线内容分发工具
  • 开发跨平台下载管理器

主要特点

  • 纯 Dart 实现
  • 跨平台支持(Android、iOS、macOS、Windows、Linux)
  • 轻量且无依赖
  • 支持 torrent 文件解析和下载管理
  • 用于跟踪下载进度的内置事件驱动架构

适合对象

  • Flutter 开发人员构建 P2P 功能
  • 需要离线或去中心化文件传输的应用程序
  • 项目避免使用原生平台特定代码
  • 探索BitTorrent协议的教育项目
  • 需要轻量级种子客户端集成的工具

使用建议

  • 仅限基本的BitTorrent功能(不支持加密或端口转发等高级功能)
  • 由于纯 Dart 执行,低端设备上的性能可能有所不同
  • 无内置 UI 组件——需要自定义界面开发
  • 依赖外部跟踪器和对等节点来确定内容的可用性
  • 不适用于高容量或企业级的种子操作

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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.

所属分类

依赖

依赖清单 13 项

  • 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

源码仓库

使用此插件的项目

暂无相关数据。