mirror of
https://github.com/openfoodfacts/smooth-app.git
synced 2025-08-14 18:58:06 +08:00
21 lines
584 B
Dart
21 lines
584 B
Dart
import 'package:openfoodfacts/openfoodfacts.dart';
|
|
import 'package:openfoodfacts/utils/OpenFoodAPIConfiguration.dart';
|
|
|
|
class QuestionsQuery {
|
|
Future<List<RobotoffQuestion>> getQuestions() async {
|
|
final User user = OpenFoodAPIConfiguration.globalUser!;
|
|
|
|
// TODO(vaiton): Not to sure about this
|
|
final String lc = OpenFoodAPIConfiguration.globalLanguages![0].code;
|
|
|
|
final RobotoffQuestionResult result =
|
|
await OpenFoodAPIClient.getRandomRobotoffQuestion(
|
|
lc,
|
|
user,
|
|
count: 3,
|
|
);
|
|
|
|
return result.questions ?? <RobotoffQuestion>[];
|
|
}
|
|
}
|