putAll method
- Iterable<
Product> products, - OpenFoodFactsLanguage language, {
- required ProductType productType,
Replaces products in database
Implementation
Future<void> putAll(
Iterable<Product> products,
OpenFoodFactsLanguage language, {
required ProductType productType,
}) async {
for (final Product product in products) {
// in case the server product has no product type, which shouldn't happen
// in the future
product.productType ??= productType;
}
await localDatabase.database.transaction(
(Transaction transaction) async =>
_bulkReplaceLoop(transaction, products, language, productType),
);
}