mirror of
https://github.com/openfoodfacts/smooth-app.git
synced 2025-08-14 02:30:54 +08:00

* fix: Language code usage * Update main.dart * Fix for local != lc * Update product_preferences.dart * Update main.dart * Fix tagline * Update tagline.dart
20 lines
575 B
Dart
20 lines
575 B
Dart
import 'package:openfoodfacts/openfoodfacts.dart';
|
|
import 'package:openfoodfacts/utils/OpenFoodAPIConfiguration.dart';
|
|
import 'package:smooth_app/query/product_query.dart';
|
|
|
|
class QuestionsQuery {
|
|
Future<List<RobotoffQuestion>> getQuestions() async {
|
|
final User user = OpenFoodAPIConfiguration.globalUser!;
|
|
final String lc = ProductQuery.getLanguage().code;
|
|
|
|
final RobotoffQuestionResult result =
|
|
await OpenFoodAPIClient.getRandomRobotoffQuestion(
|
|
lc,
|
|
user,
|
|
count: 3,
|
|
);
|
|
|
|
return result.questions ?? <RobotoffQuestion>[];
|
|
}
|
|
}
|