getRobotoffQuestionsForProduct static method
Implementation
static Future<RobotoffQuestionResult> getRobotoffQuestionsForProduct(
String barcode,
String lang, {
User? user,
int? count,
QueryType? queryType,
}) async {
if (count == null || count <= 0) {
count = 1;
}
final Map<String, String> parameters = <String, String>{
'lang': lang,
'count': count.toString()
};
var robotoffQuestionUri = UriHelper.getRobotoffUri(
path: 'api/v1/questions/$barcode',
queryParameters: parameters,
queryType: queryType,
);
Response response = await HttpHelper().doGetRequest(
robotoffQuestionUri,
user: user,
queryType: queryType,
);
var result = RobotoffQuestionResult.fromJson(
json.decode(utf8.decode(response.bodyBytes)));
return result;
}