从网络获取下载地址

This commit is contained in:
2024-02-24 18:18:35 +08:00
parent a6a086fea3
commit 3d92508819
5 changed files with 105 additions and 35 deletions

View File

@ -58,7 +58,7 @@ class DownloadsUI extends BaseUI<DownloadsUIModel> {
child: ListView.builder(
itemBuilder: (BuildContext context, int index) {
final (task, type, isFirstType) = model.getTaskAndType(index);
final nt = model.getTaskTypeAndName(task);
final nt = DownloadsUIModel.getTaskTypeAndName(task);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

View File

@ -110,7 +110,7 @@ class DownloadsUIModel extends BaseUIModel {
throw Exception("Index out of range or element is null");
}
MapEntry<String, String> getTaskTypeAndName(Aria2Task task) {
static MapEntry<String, String> getTaskTypeAndName(Aria2Task task) {
if (task.bittorrent == null) {
String uri = task.files?[0]['uris'][0]['uri'] as String;
return MapEntry("url", uri.split('/').last);