Files
smooth-app/packages/smooth_app/lib/database/robotoff_questions_query.dart
cli1005 f67180785d fix: #1352 - robotoff insight card shows permanently (#1574)
* fix: #1395 - show newly added product in carousel

* fix: #1395 - refactoring unused import

* fix: #1395 - refactoring make variable private

* fix: #1352 - robotoff card shows permanently

* fix: #1352 - codereview refactoring

* fix: #1352 - check fix

* fix: #1352 - pretest check fix

* fix: #1352 - codereview fix

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2022-04-21 10:58:52 +02:00

19 lines
545 B
Dart

import 'dart:async';
import 'package:openfoodfacts/openfoodfacts.dart';
import 'package:smooth_app/database/product_query.dart';
class RobotoffQuestionsQuery {
RobotoffQuestionsQuery(this._barcode);
final String _barcode;
Future<List<RobotoffQuestion>> getRobotoffQuestionsForProduct() async {
final RobotoffQuestionResult result =
await OpenFoodAPIClient.getRobotoffQuestionsForProduct(
_barcode,
ProductQuery.getLanguage().code,
count: 3,
);
return result.questions ?? <RobotoffQuestion>[];
}
}