opt trending header

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-30 19:23:41 +08:00
parent ed6353e6d5
commit f615a43259
5 changed files with 95 additions and 64 deletions

View File

@@ -262,6 +262,7 @@ abstract final class SearchHttp {
static Future<LoadingState<SearchTrendingData>> searchTrending({
int limit = 30,
bool needsTop = false,
}) async {
final res = await Request().get(
Api.searchTrending,
@@ -270,7 +271,9 @@ abstract final class SearchHttp {
},
);
if (res.data['code'] == 0) {
return Success(SearchTrendingData.fromJson(res.data['data']));
return Success(
SearchTrendingData.fromJson(res.data['data'], needsTop: needsTop),
);
} else {
return Error(res.data['message']);
}