addTask method
add download task
return
gid
Implementation
Future<String> addTask(List<String> urls,
{VoidCallback? onComplete, VoidCallback? onError}) async {
if (client != null) {
final opt = await createAriaTaskOption(extraOptions: {});
final gid = await addAriaTask(
urls: urls,
client: client!,
options: opt,
onComplete: onComplete ?? () {},
onError: onError ?? () {});
return gid;
}
throw Aria2Error(message: 'please connect first');
}