getQuestions method
- LocalDatabase localDatabase,
- int count
override
Implementation
@override
Future<List<RobotoffQuestion>> getQuestions(
LocalDatabase localDatabase,
int count,
) async {
final RobotoffQuestionResult result =
await RobotoffAPIClient.getProductQuestions(
barcode,
ProductQuery.getLanguage(),
count: count,
uriHelper: ProductQuery.uriRobotoffHelper,
);
if (result.questions?.isNotEmpty != true) {
return <RobotoffQuestion>[];
}
await ProductRefresher().silentFetchAndRefresh(
barcode: barcode,
localDatabase: localDatabase,
);
return result.questions ?? <RobotoffQuestion>[];
}