page view

This commit is contained in:
wgh19
2024-05-17 17:51:50 +08:00
parent 67ebe4e50b
commit 1fecb8d55d
10 changed files with 146 additions and 17 deletions

View File

@@ -208,13 +208,14 @@ class Network {
}
}
static const recommendationUrl = "/v1/illust/recommended?include_privacy_policy=true&filter=for_android&include_ranking_illusts=true";
Future<Res<List<Illust>>> getRecommendedIllusts() async {
var res = await apiGet(
"/v1/illust/recommended?include_privacy_policy=true&filter=for_android&include_ranking_illusts=true");
var res = await apiGet(recommendationUrl);
if (res.success) {
return Res((res.data["illusts"] as List)
.map((e) => Illust.fromJson(e))
.toList());
.toList(), subData: recommendationUrl);
} else {
return Res.error(res.errorMessage);
}