fetchSearchResults method

Future<SearchResult> fetchSearchResults({
  1. required String searchQuery,
})

Implementation

Future<SearchResult> fetchSearchResults({required String searchQuery}) async {
  try {
    var response = await http.get(Uri.parse(searchUrl(searchQuery)),
        headers: {"Accept": "application/json"});
    var map = json.decode(response.body);
    return PluginFactory.createSearchResult(map);
  } catch (e) {
    throw e;
  }
}