getTrendingCategory static method

Future<SearchResultOfTrendingEntryResponse> getTrendingCategory(
  1. HttpClient client,
  2. String categoryId,
  3. int pageNumber
)

Returns paginated lists of trending items for a category.

Implementation

static Future<SearchResultOfTrendingEntryResponse> getTrendingCategory (
    HttpClient client,
    String categoryId,
    int pageNumber,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _categoryId = '$categoryId';
    final String _pageNumber = '$pageNumber';
    final HttpClientConfig config = HttpClientConfig('GET', '/Trending/Categories/$_categoryId/$_pageNumber/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return SearchResultOfTrendingEntryResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}