searchDestinyEntities static method

Future<DestinyEntitySearchResultResponse> searchDestinyEntities(
  1. HttpClient client,
  2. int page,
  3. String searchTerm,
  4. String type,
)

Gets a page list of Destiny items.

Implementation

static Future<DestinyEntitySearchResultResponse> searchDestinyEntities (
    HttpClient client,
    int page,
    String searchTerm,
    String type,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _searchTerm = '$searchTerm';
    final String _type = '$type';
    params['page'] = page;
    final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/Armory/Search/$_type/$_searchTerm/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return DestinyEntitySearchResultResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}