{"id":15008420,"url":"https://github.com/davenchy/libtorrent-dart-bindings-example","last_synced_at":"2025-10-03T16:31:35.830Z","repository":{"id":229950894,"uuid":"778081262","full_name":"Davenchy/libtorrent-dart-bindings-example","owner":"Davenchy","description":"A simple example on how to write libtorrent bindings for dart lang","archived":true,"fork":false,"pushed_at":"2024-04-24T04:56:38.000Z","size":242,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-29T16:02:59.033Z","etag":null,"topics":["bindings","dart","dart-ffi","dartlang","example","ffi","libtorrent","torrent"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Davenchy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-27T03:17:52.000Z","updated_at":"2024-08-05T02:55:44.000Z","dependencies_parsed_at":"2024-03-27T04:41:42.250Z","dependency_job_id":null,"html_url":"https://github.com/Davenchy/libtorrent-dart-bindings-example","commit_stats":null,"previous_names":["davenchy/libtorrent-dart-bindings-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davenchy%2Flibtorrent-dart-bindings-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davenchy%2Flibtorrent-dart-bindings-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davenchy%2Flibtorrent-dart-bindings-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davenchy%2Flibtorrent-dart-bindings-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Davenchy","download_url":"https://codeload.github.com/Davenchy/libtorrent-dart-bindings-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235155997,"owners_count":18944824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","dart","dart-ffi","dartlang","example","ffi","libtorrent","torrent"],"created_at":"2024-09-24T19:18:37.001Z","updated_at":"2025-10-03T16:31:35.451Z","avatar_url":"https://github.com/Davenchy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LibTorrent Dart Bindings Example\n\n## Introduction\n\nHello there! Welcome to this example project demonstrating how to create LibTorrent bindings for the Dart language. I hope you find it helpful and informative.\n\n![Output Example](screenshot.png)\n\n## Why??\n\nEverything started from here [https://github.com/dart-lang/native/issues/218](https://github.com/dart-lang/native/issues/218)\n\n## Requirements\n\nBefore diving in, make sure you have the following prerequisites installed:\n\n- Ensure libtorrent shared library is installed on your system and recognized by the compiler using the flag `-ltorrent-rasterbar`.\n- If you have libtorrent source files in a custom path, update the `wrapper/Makefile` accordingly.\n- You'll also need to have the [Dart SDK](https://dart.dev/get-dart) installed.\n\n## Makefile\n\n- The `wrapper/Makefile` contains various useful rules to streamline the development process:\n\n1. **debug**: Builds a test binary with gdb flag enabled for testing/debugging process.\n2. **run**: Similar to `debug`, but it also runs the binary after building.\n3. **build**: This rule is responsible for building the wrapper library: `libwrapper.so` by default.\n\n## Build the Wrapper Library\n\n- To build the wrapper library, execute the following command:\n\n```sh\nmake build\n```\n\n## Run the Example Project\n\nOnce you've built the wrapper library, follow these steps to run the example project:\n\n1. Copy the library file `libwrapper.so` into the Dart project directory.\n2. Get dart packages\n\n```sh\ndart pub get\n```\n\n2. Run the project using the following command:\n\n```sh\ndart run\n```\n\n## Additional Resources\n\nIf you want to dive deeper into LibTorrent, here are some helpful resources:\n\n### LibTorrent Documentation\n\n- [LibTorrent Tutorial](https://www.libtorrent.org/tutorial-ref.html)\n- [Settings Pack](https://www.libtorrent.org/reference-Settings.html#settings_pack)\n- [Alert Categories](https://www.libtorrent.org/reference-Alerts.html#alert-category-t)\n- [Alerts](https://www.libtorrent.org/reference-Alerts.html#overview)\n- [Parse Magnet URI](https://www.libtorrent.org/reference-Core.html#parse_magnet_uri())\n- [Add Torrent Parameters](https://www.libtorrent.org/reference-Add_Torrent.html#add_torrent_params)\n- [Session Handle](https://www.libtorrent.org/reference-Session.html#session_handle)\n- [Torrent Handle](https://www.libtorrent.org/reference-Torrent_Handle.html#torrent_handle)\n- [Torrent Info](https://www.libtorrent.org/reference-Torrent_Info.html#torrent_info)\n- [File Storage](https://www.libtorrent.org/reference-Storage.html)\n\n### Dart FFI\n\n- [C interop using dart:ffi](https://dart.dev/interop/c-interop)\n- [dart-lang repo ffi samples](https://github.com/dart-lang/samples/tree/main/ffi)\n\n### StackOverflow\n\n- [Developing C wrapper API for Object-Oriented C++ code](https://stackoverflow.com/q/2045774/8046862)\n- [How to create a shared library in android and use it in flutter?](https://stackoverflow.com/q/74063116/8046862)\n\n### Other\n\n- [GeeksForGeeks:extern-c-in-c](https://www.geeksforgeeks.org/extern-c-in-c/)\n\n## Contribution\n\nFeel free to fork this project or create pull requests if you'd like to contribute. **Your feedback and contributions are highly appreciated!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavenchy%2Flibtorrent-dart-bindings-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavenchy%2Flibtorrent-dart-bindings-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavenchy%2Flibtorrent-dart-bindings-example/lists"}