Last updated:
0 purchases
aria2 dart
aria2_dart #
The flutter aria2 downloader based on aria2_ws (rust) supports all platforms of Android, iOS, macOS, Windows, Linux and Web
Getting Started #
development environment:flutter:3.19.3
cd example && flutter clean
flutter run
copied to clipboard
add to pubspec.yaml
aria2_dart: ^lastVersion
copied to clipboard
Api #
1.Connection
address: aria2 connection address, example:ws://127.0.0.1:6800/jsonrpc
await Aria2Plugin().connect(address);
copied to clipboard
2.Add download task
urls: remote download link
await Aria2Plugin().addTask([...urls]);
copied to clipboard
3.Listen for task callbacks
Aria2Plugin().addListen(listen: (MyNotification value){
value.when(aria2: (gid, event) {
//todo aria2 event callback
}, webSocketConnected: () {
//todo connected
}, websocketClosed: () {
//todo closed
});
// or value.whenOrNull();
});
copied to clipboard
4.Get task details
gid: Task ID, returned from aria 2
Aria2Plugin().getInfo(gid).then((AriaDetail? r) {
if (r != null) {
infos[key] = r;
}
});
copied to clipboard
Disconnect and release memory
Client? client;
...
client?.dispose();
copied to clipboard
For more usage methods, please refer to the example directory
Related Links #
aria2_ws(rust)
flutter_rust_bridge(flutter)
aria2 docs
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.