getProductInsights static method

Future<InsightsResult> getProductInsights(
  1. String barcode,
  2. User user, {
  3. QueryType? queryType,
})

Implementation

static Future<InsightsResult> getProductInsights(
  String barcode,
  User user, {
  QueryType? queryType,
}) async {
  var insightsUri = UriHelper.getRobotoffUri(
    path: 'api/v1/insights/$barcode',
    queryType: queryType,
  );

  Response response = await HttpHelper().doGetRequest(
    insightsUri,
    user: user,
    queryType: queryType,
  );

  return InsightsResult.fromJson(
      json.decode(utf8.decode(response.bodyBytes)));
}