searchProducts static method
Future<SearchResult>
searchProducts(
- User? user,
- AbstractQueryConfiguration configuration, {
- QueryType? queryType,
Search the OpenFoodFacts product database with the given parameters. Returns the list of products as SearchResult. Query the language specific host from OpenFoodFacts.
Implementation
static Future<SearchResult> searchProducts(
final User? user,
final AbstractQueryConfiguration configuration, {
final QueryType? queryType,
}) async {
final Response response = await configuration.getResponse(user, queryType);
final String jsonStr = _replaceQuotes(response.body);
final SearchResult result = SearchResult.fromJson(json.decode(jsonStr));
_removeImages(result, configuration);
return result;
}