load illust with id; context menu

This commit is contained in:
wgh19
2024-05-14 22:15:05 +08:00
parent faa857b814
commit a8b0495fc6
6 changed files with 151 additions and 66 deletions

View File

@@ -391,4 +391,13 @@ class Network {
return Res.fromErrorRes(res);
}
}
Future<Res<Illust>> getIllustByID(String id) async {
var res = await apiGet("/v1/illust/detail?illust_id=$id");
if (res.success) {
return Res(Illust.fromJson(res.data["illust"]));
} else {
return Res.error(res.errorMessage);
}
}
}