following artworks page

This commit is contained in:
wgh19
2024-05-13 20:14:50 +08:00
parent 13ef786280
commit f3125ddc9a
4 changed files with 115 additions and 1 deletions

View File

@@ -336,4 +336,15 @@ class Network {
return Res.error(res.errorMessage);
}
}
Future<Res<List<Illust>>> getFollowingArtworks(String restrict, [String? nextUrl]) async {
var res = await apiGet(nextUrl ?? "/v2/illust/follow?restrict=$restrict");
if (res.success) {
return Res(
(res.data["illusts"] as List).map((e) => Illust.fromJson(e)).toList(),
subData: res.data["next_url"]);
} else {
return Res.error(res.errorMessage);
}
}
}