6 Commits

Author SHA1 Message Date
e3bc40fdf3 chore: Migration to Dart 3.8 (#6668)
* Migration to Dart 3.8

* New GA

* Fix dartdoc
2025-06-23 18:14:17 +02:00
4d48671e3c feat: 5741 - respecting the "search products" access limitations (#5810)
* feat: 5741 - respecting the "search products" access limitations

New file:
* `search_products_manager.dart`: Management of "search products" access limitations.

Impacted files:
* `background_task_download_products.dart`: refactored using `SearchProductsManager`
* `background_task_language_refresh.dart`: refactored using `SearchProductsManager`
* `background_task_top_barcodes.dart`: refactored using `SearchProductsManager`
* `lazy_counter.dart`: refactored using `SearchProductsManager`
* `paged_product_query.dart`: refactored using `SearchProductsManager`
* `product_list_page.dart`: refactored using `SearchProductsManager`
* `product_refresher.dart`: refactored using `SearchProductsManager`
* `pubspec.lock`: wtf

* fix: 5618 - category comparison for OxF

Impacted files:
* `background_task_language_refresh.dart`: explicitly setting the product_type
* `dao_product.dart`: made `productType` mandatory and not null for `put` and `putAll`
* `new_product_footer.dart`: fixed case with unexploitable `comparedToCategory` field
* `product_list_page.dart`: explicitly setting the product_type
* `product_refresher.dart`: explicitly setting the product_type
* `pubspec.lock`: wtf
* `query_product_list_supplier.dart`: explicitly setting the product_type

* fix: 5617 - share link to correct Oxf server

* fix: 5617 - share link to correct Oxf server

Impacted files:
* `app_en.arb`: added labels for sharing an Oxf product
* `new_product_footer.dart`: now displaying a correct label for product sharing - in addition to correct url
* `product_query.dart`: added labels for sharing an Oxf product
* `pubspec.lock`: wtf
* `pubspec.yaml`: downgraded sentry_flutter from problematic version

---------

Co-authored-by: Edouard Marquez <g123k@users.noreply.github.com>
2024-11-09 22:52:04 +01:00
be05e6004e feat: 5586 - added explicit product type to all relevant background tasks (#5721)
New file:
* `work_type.dart`: Type of long download work for some background tasks.

Impacted files:
* `background_task.dart`: removed the default `uriProductHelper` getter
* `background_task_barcode.dart`: added a `uriProductHelper` getter that depends on the `productType`
* `background_task_download_products.dart`: refactored the access to product type
* `background_task_full_refresh.dart`: split by product type
* `background_task_language_refresh.dart`: split by product type
* `background_task_offline.dart`: refactored the access to product type
* `background_task_progressing.dart`: added the `productType` parameter; moved code to new `WorkType` class
* `background_task_top_barcodes.dart`: refactored the access to product type
* `dao_product.dart`: new methods `getProductTypes` and `splitAllProducts`; refactored with product type
* `lazy_counter.dart`: explicitly counting the "food" products
* `newsfeed_provider.dart`: explicitly getting the news from "food"
* `offline_data_page.dart`: now displaying "download top N products" buttons for each product type; stats for each product type
* `offline_tasks_page.dart`: enhanced "work text" algo, now depending on product type
* `operation_type.dart`: enhanced "key" algo, now depending on product type
* `ordered_nutrients_cache.dart`: explicitly using the "food" nutrients
* `product_list_page.dart`: now reloading products from their server
* `product_list_popup_items.dart`: now linking to the first server with products
* `product_query.dart`: made product type a mandatory parameter
* `product_refresher.dart`: added mandatory parameter product type
* `random_questions_query.dart`: explicitly ask for "food" robotoff products
* `temp_product_list_share_helper.dart`: added mandatory parameter product type
* `user_preferences_dev_debug_info.dart`: added explicit use of "food" data
2024-10-26 00:27:35 +02:00
db080d2d09 fix: 5634 - refresh of price lazy counters when accessing lists (#5678)
Impacted files:
* `get_prices_model.dart`: added a `LazyCounterPrices?` parameter
* `lazy_counter.dart`: added a `bool notify` parameter
* `lazy_counter_widget.dart`: now refreshed by "external" new count
* `price_user_button.dart`: added a `LazyCounterPrices` parameter to have the counter refreshed
* `product_prices_list.dart`: now setting the lazy counter when displaying the list
* `user_preferences.dart`: added a `bool notify` parameter for the lazy counter setter
* `user_preferences_account.dart`: added a `LazyCounterPrices` parameter to have the counter refreshed
2024-10-13 19:33:14 +02:00
93fc899301 fix: 5576 - first step towards multi product types (#5593)
Impacted files:
* `add_basic_details_page.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `background_task.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `background_task_download_products.dart`: saved new field `Product.productType`
* `dao_product.dart`: now we're storing the `Product.productType` field
* `edit_new_packagings.dart`: now using new field `Product.productType`
* `edit_new_packagings_component.dart`: now using new field `Product.productType`
* `edit_product_page.dart`: specific icon for "food" categories; no nutrition for "beauty" and "product"
* `forgot_password_page.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `lazy_counter.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `login_result.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `newsfeed_provider.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `ocr_ingredients_helper.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `ocr_packaging_helper.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `onboarding_data_product.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `ordered_nutrients_cache.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `paged_product_query.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `product_cards_helper.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `product_image_crop_button.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `product_image_gallery_other_view.dart`: now using new field `Product.productType`
* `product_image_other_page.dart`: now using new field `Product.productType`
* `product_image_server_button.dart`: now using new field `Product.productType`
* `product_image_widget.dart`: now using new field `Product.productType`
* `product_list_page.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `product_query.dart`: now when we look for a barcode (or refresh a product), we use all productTypes if needed
* `product_refresher.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded `openfoodfacts` to `3.15.0` for new `Product.productType` field
* `sign_up_page.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `simple_input_page_helpers.dart`: new class dedicated to non-food categories
* `simple_input_text_field.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `simple_input_widget.dart`: now using new field `Product.productType`
* `temp_product_list_share_helper.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
* `uploaded_image_gallery.dart`: now using new field `Product.productType`
* `user_preferences_dev_debug_info.dart`: replaced getter `ProductQuery.uriProductHelper` with method `ProductQuery.getUriProductHelper`
2024-09-25 10:28:57 +02:00
74660f80d0 fix: 5554 - display of cached counts on user page (#5573)
New files:
* `lazy_counter.dart`: Lazy Counter, with a cached value stored locally, and a call to the server.
* `lazy_counter_widget.dart`: Widget displaying a Lazy Counter: cached value, refresh button, and loading.

Impacted files:
* `user_preferences.dart`: added methods about storing a lazy count value
* `user_preferences_account.dart`: refactored the display of counts with the new `LazyCounter` and `LazyCounterWidget` classes
2024-09-11 11:53:24 +02:00