95 Commits

Author SHA1 Message Date
1b70203d0b fix: 6784 - readyForPriceTagValidation true only for priceTag and bulk (#6794)
* fix: 6784 - readyForPriceTagValidation true only for priceTag and bulk

Impacted files:
* `background_task_add_price.dart`: added field and parameter `bool bulkProofUpload`; set `readyForPriceTagValidation` as "priceTag and bulk"
* `price_bulk_proof_card.dart`: added warning about AI and image validation
* `price_model.dart`: added field `bool bulkProofUpload`
* `proof_bulk_add_page.dart`: added parameter `bulkProofUpload: true`

* Replaced parameter bulkProofUpload with readyForPriceTagValidation

Impacted files:
* `background_task_add_price.dart`: replaced parameter bulkProofUpload with readyForPriceTagValidation
* `price_bulk_proof_card.dart`: added a switch to change the value of readyForPriceTagValidation
* `price_model.dart`: readyForPriceTagValidation with getter and setter
* `proof_bulk_add_page.dart`: start with the default user value for readyForPriceTagValidation
* `user_preferences.dart`: storing the default user value for readyForPriceTagValidation

* minor fix

* Localization
2025-07-30 15:35:38 +02:00
033f2e567b fix: Background tasks and support dirs on iOS devices (#6722)
* Fix support dir changed

* Improve code logic
2025-07-28 16:18:22 +02:00
800344f2ee feat: 6790 - reuse price tokens (#6793)
Impacted files:
* `background_task_add_other_price.dart`: minor refactoring
* `background_task_add_price.dart`: minor refactoring
* `background_task_price.dart`: now using new method `ProductQuery.getPriceToken` to get the token; never closing the token session at the end
* `infinite_scroll_manager.dart`: minor refactoring
* `prices_proofs_page.dart`: minor refactoring
* `product_query.dart`: new method `getPriceToken` that caches the token
2025-07-21 17:14:25 +02:00
2396d04286 feat: 5689 - separate tasks (proof upload and prices adding) (#6781)
Impacted files:
* `background_task_add_other_price.dart`: can be called silently from another task
* `background_task_add_price.dart`: now splitting price adding into one-price-one-task
* `background_task_price.dart`: if successful, the proof upload calls another task and that's it
* `price_to_oxf.dart`: slightly unrelated patch about multiproduct search being crap
2025-07-17 19:28:48 +02:00
9829a10cc8 feat: 6591 - update OxF data with Prices data (#6667)
* feat: 6591 - update OxF data with Prices data

New file:
* `price_to_oxf.dart`: Tool to update OxF data from Prices data.

Impacted files:
* `background_task.dart`: unrelated minor refactoring
* `background_task_details.dart`: minor refactoring
* `background_task_price.dart`: now updating OxF products with Prices data
* `simple_input_page_helpers.dart`: minor refactoring

* merging

* format

* sorry about that, couldn't merge "develop"

* effing stupid dart format

* effing stupid dart format, again

---------

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2025-07-14 16:34:01 +02:00
5cb90d9ecd fix: 6759 - changed bulk proof uploading display (#6766)
Impacted files:
* `background_task_add_price.dart`: snackbar display is now optional
* `price_bulk_proof_card.dart`: changed the display of the upload process - no snackbar, text replacing the button
* `price_model.dart`: minor refactoring
* `product_price_add_page.dart`: minor refactoring
2025-07-14 16:23:05 +02:00
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
dda75e283e feat: Flutter 3.32 (#6665)
* Migration to Flutter 3.32

* Temporary ignore dart formatter issues
2025-06-23 09:56:00 +02:00
9db5c5ef9e feat: 5553 - add prices for category products (#6552)
* feat: 5553 - add prices for category products

New files:
* `price_category_input_page.dart`: Page that lets the user type in and select a single category for prices.
* `price_per_extension.dart`: Extension for PricePer.

Impacted files:
* `app_en.arb`: added 4 labels related to category and prices
* `app_fr.arb`: added 4 labels related to category and prices
* `background_task_add_other_price.dart`: added parameters related to category prices
* `background_task_add_price.dart`: added parameters related to category prices
* `background_task_price.dart`: added parameters related to category prices
* `price_add_product_card.dart`: added an "add category product" button
* `price_amount_card.dart`: added a DropDownButton for "price per" for category product
* `price_amount_model.dart`: taken category prices into consideration
* `price_existing_amount_card.dart`: unrelated localization
* `price_meta_product.dart`: added a new meta product, related to category
* `price_model.dart`: added parameters related to category prices
* `smooth_autocomplete_text_field.dart`: added an "onSelected" optional parameter, in order to be able to select immediately a suggestion
* `smooth_dropdown.dart`: added an "isExpanded" optional parameter, in order to match the screen width

* minor refactoring and localizations

Impacted files:
* `app_en.arb`: additional translations for "price per"
* `app_fr.arb`: additional translations for "price per"
* `price_existing_amount_field.dart`: localization
* `price_meta_product.dart`: minor refactoring
* `price_per_extension.dart`: additional translations for "price per"

* reformatting

* added origins and prepared code for labels

Impacted files:
* `app_en.arb`: improved a label and added 3 labels
* `app_fr.arb`: improved a label and added 3 labels
* `background_task_add_other_price.dart`: now setting origins and labels
* `background_task_add_price.dart`: now setting origins and labels
* `background_task_price.dart`: now setting origins and labels
* `price_add_product_card.dart`: refactored as we now set origins too (in addition to just category)
* `price_category_input_page.dart`: refactored as we now set origins too (in addition to just category)
* `price_existing_amount_card.dart`: display origins too
* `price_meta_product.dart`: now setting and displaying origins too
* `price_model.dart`: we now set origins too, and prepared code for labels when ready on the "prices" side
* `price_product_list_tile.dart`: now displaying origins too

* someone moved a file and that's not nice ;)

* explicit 1 line for autocomplete
2025-06-12 18:13:26 +02:00
bed4d8b436 fix: 6560 - explicit readyForPriceTagValidation parameter for proof upload (#6573)
* fix: 6560 - explicit readyForPriceTagValidation parameter for proof upload

Impacted files:
* `background_task_add_price.dart`: added explicit `readyForPriceTagValidation` parameter for proof upload
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded `openfoodfacts` to `3.22.0`

* upgraded PricesStatsPage too to openfoodfacts 3.22.0
2025-05-06 11:46:37 +02:00
b3b9ed8ad9 feat: 4679 - added a way to edit traces (#6495)
* feat: 4679 - added a way to edit traces

New file:
* `simple_input_page_trace_helper.dart`: Implementation for "Traces" of an AbstractSimpleInputPageHelper.

Impacted files:
* `analytics_helper.dart`: added an entry for "traces"
* `app_en.arb`: added labels for "traces"
* `background_task_details.dart`: added an entry for "traces"
* `edit_product_page.dart`: added a button for "traces"
* `product_query.dart`: added entries for "traces"
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to off-dart 3.21.0, where we can edit traces
* `simple_input_page_helpers.dart`: added a warning "TODO" about the file being too big
* `up_to_date_changes.dart`: added an entry for "traces"

* stupid formatter error

* my bad, this time
2025-04-13 12:05:45 +02:00
d1324dfabe feat: 6104 - "eraser" feature for new images of "product" products (#6388)
Impacted files:
* `background_task_add_price.dart`: minor refactoring
* `background_task_image.dart`: added `eraserCoordinates` field; moved here code about "eraser overlayPainter"
* `crop_helper.dart`: new methods `getEraserCoordinates` and `getOffsets`; minor refactoring
* `product_crop_helper.dart`: added "eraser" for "ProductType.product" only; minor refactoring
* `proof_crop_helper.dart`: minor refactoring
2025-02-22 21:25:50 +01:00
8306848574 fix: Only set the product language on addition (#6386)
* Only set the product language on addition

* TODO style
2025-02-17 15:15:18 +01:00
75fc7b5d35 fix: 6249 - refresh of the prices of a product after a related price addition (#6361)
New file:
* `product_price_refresher.dart`: Async refresh of the prices of a product, with several loading phases.

Impacted files:
* `background_task_add_other_price.dart`: minor refactoring
* `background_task_add_price.dart`: minor refactoring
* `background_task_price.dart`: now aftrer we add a price, we signal that the related product price counts needs to be refreshed
* `prices_card.dart`: used the new `ProductPriceRefresher` class for async data loading
* `product_prices_list.dart`: used the new `ProductPriceRefresher` class for async data loading; refactored the display of the list in a separate class
2025-02-10 10:39:19 +01:00
23288dfc44 feat: Less annoying floating spam (#6190)
* Less annoying floating spam

* Ooops, remove that test, Edouard

* No message for pictures

* Better edit product page banner
2025-01-13 14:17:00 +01:00
d7b876cd45 fix: 5933 - less greedy language refresh (#6038)
* fix: 5933 - less greedy language refresh

Impacted files:
* `background_task_language_refresh.dart`: now we restart only the dedicated product type queue instead of all
* `operation_type.dart`: new `getProductType` method; minor refactoring
* `offline_tasks_page.dart`: display the product type for tasks, when available

* Optimized database query

* Typo fix
2025-01-04 09:36:23 +01:00
a7a99909a9 feat: 5952 - better image compression for Prices (#6048)
Impacted files:
* `image_compute_container.dart`: added the compression quality parameter
* `background_task_image.dart`: added the compression quality and force quality parameters; same parameters as before for OxF images (quality 100, no forced compression for non cropped images)
* `background_task_add_price.dart`: always compress the proof image, with quality 80
2024-12-20 16:19:31 +01:00
5a38f01f51 fix: 5864 - more verbose error message for details (#5892)
* fix: 5864 - more verbose error message for details

* off-dart 3.7.1 with product_type not included if null

* error AND status_verbose
2024-11-21 20:52:45 +01:00
5a0ba55e96 feat: 5855 - no visible product type filter by default (#5878)
* feat: 5855 - no visible product type filter by default

Impacted files:
* `background_task_price.dart`: minor unrelated fix due to off-dart 3.17.0
* `dao_product.dart`: we overwrite the products product_type with the server product type only if null
* `product_query.dart`: now retrieving product_type field in products found on a server
* `product_refresher.dart`: unrelated minor refactoring
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded off-dart to 3.17.0
* `search_product_helper.dart`: visible/invisible product type filter, by default invisible and working on food
* `user_preferences_dev_mode.dart`: on/off switch for visible product type filter, off by default

* Move the setting to "App settings"

---------

Co-authored-by: Edouard Marquez <moi@edouard-marquez.me>
Co-authored-by: Edouard Marquez <g123k@users.noreply.github.com>
2024-11-19 08:34:13 +01: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
3260024a56 fix: 5742 - centered tooltip after detail changes (#5751)
Impacted file:
* `background_task_details.dart`: centered instead of bottomCentered
2024-10-27 16:02:59 +01:00
69bb171a20 feat: 5405 - 3 queues for background tasks (fast, slow, long haul) (#5743)
New file:
* `background_task_queue.dart`: Queues for Background Tasks.

Impacted files:
* `background_task.dart`: now we add tasks to a specific queue
* `background_task_add_other_price.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_add_price.dart`: assigned to `BackgroundTaskQueue.slow`
* `background_task_badge.dart`: minor refactoring
* `background_task_crop.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_details.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_download_products.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_full_refresh.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_hunger_games.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_image.dart`: assigned to `BackgroundTaskQueue.slow`
* `background_task_language_refresh.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_manager.dart`: now using new class `BackgroundTaskQueue` in order to use multiple queues
* `background_task_offline.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_refresh_later.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_top_barcodes.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_unselect.dart`: assigned to `BackgroundTaskQueue.fast`
* `dao_string_list.dart`: added 2 queues
* `local_database.dart`: now running all queues
* `local_database_mock.dart`: minor refactoring
* `offline_tasks_page.dart`: now taking queues into account
* `up_to_date_mixin.dart`: now running all queues
* `user_preferences_page.dart`: now running all queues
2024-10-27 13:06:29 +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
a8cfcd02ce fix: 5693 - able to run tasks without minimum duration wait (#5694)
* fix: 5693 - able to run tasks without minimum duration wait

Impacted files:
* `background_task_manager.dart`: made it possible to force an immediate run if possible
* `offline_tasks_page.dart`: force an immediate run if possible when clicking on the refresh button

* Added a call to BackgroundTaskManager.run related to prices

* Minor fix

* Wtf tests

* Ugly fix for mocking hive
2024-10-20 14:17:21 +02:00
19ed4f0e74 feat: 5326 - add prices to proof from gallery (and thumbnails) (#5670)
* feat: 5326 - add prices to proof from gallery (and thumbnails)

New files:
* `background_task_add_other_price.dart`: Background task about adding prices to an existing proof.
* `background_task_price.dart`: Abstract background task about adding prices.

Impacted files:
* `background_task_add_price.dart`: refactored using new class `BackgroundTaskPrice`
* `get_prices_model.dart`: new web app root address
* `operation_type.dart`: added the new background task
* `osm_location.dart`: minor refactoring
* `price_currency_selector.dart`: additional case - proof instead of input; refactored using model
* `price_date_card.dart`: additional case - proof instead of input
* `price_location_card.dart`: additional case - proof instead of input
* `price_model.dart`: added specific constructor and background task for the "existing proof" case
* `price_product_widget.dart`: minor refactoring
* `price_proof_card.dart`: additional case - proof instead of input
* `price_proof_page.dart`: added a FAB to add price from an existing proof; now displaying the thumbnail and then the full proof
* `price_user_button.dart`: new web app root address
* `prices_proofs_page.dart`: proof thumnails; new web app root address
* `prices_users_page.dart`: new web app root address
* `product_price_add_page.dart`: now accepting a model as parameter, in order to deal with both old proofs and new prices
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to `openfoodfacts` `3.16.0`, for proof thumbnails
* `user_preferences_account.dart`: new web app root address

* More flexibility with potentially null data

Impacted files:
* `osm_location.dart`: more flexibility with potentially null data
* `price_model.dart`: more flexibility with potentially null data; better display of thumbnail image
* `price_proof_page.dart`: more flexibility with potentially null data
2024-10-07 19:30:54 +02:00
899cb0f4ac feat: 5643 - edit of products of any product type (#5661)
Impacted files:
* `add_basic_details_page.dart`: added product type
* `add_new_product_page.dart`: added a "set product type page" for new products; added product type; minor refactoring
* `add_other_details_page.dart`: added product type
* `app_en.arb`: added 1 label per product type, and 4 labels for product type input
* `background_task_barcode.dart`: added product type
* `background_task_crop.dart`: added product type
* `background_task_details.dart`: added product type
* `background_task_hunger_games.dart`: added product type
* `background_task_image.dart`: added product type
* `background_task_refresh_later.dart`: added product type
* `background_task_unselect.dart`: added product type
* `background_task_upload.dart`: added product type
* `edit_new_packagings.dart`: added product type
* `edit_ocr_page.dart`: added product type
* `image_crop_page.dart`: added product type
* `nutrition_page_loaded.dart`: added product type
* `product_crop_helper.dart`: added product type
* `product_dialog_helper.dart`: removed irrelevant nutriscore and ecoscore logos for new found products, as we cannot say already if it's food
* `product_image_button.dart`: added product type
* `product_image_carousel_item.dart`: added product type
* `product_image_crop_button.dart`: added product type
* `product_image_gallery_view.dart`: added product type
* `product_image_local_button.dart`: added product type
* `product_image_unselect_button.dart`: added product type
* `product_image_viewer.dart`: added product type
* `product_query.dart`: localized labels for product type
* `simple_input_page.dart`: added product type
* `simple_input_page_helpers.dart`: added product type
* `up_to_date_changes.dart`: added product type
* `uploaded_image_gallery.dart`: added product type
2024-10-02 17:53:19 +02:00
a6569866d4 feat: Upgrade the Flutter version to 3.24 (#5613)
* Let's migrate the app to Flutter 3.24

* `openfoodfacts_flutter_lints` from the `main` branch

* A fix for `/// For the world view`
2024-09-26 16:48:01 +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
a8bce8ac40 feat: 5526 - new Prices prod/test url flag (#5528)
Impacted files:
* `background_task_add_prices.dart`: Prices API called using new Prices prod/test url
* `get_prices_model.dart`: Prices API called using new Prices prod/test url
* `price_user_button.dart`: Prices API called using new Prices prod/test url
* `prices_proofs_page.dart`: Prices API called using new Prices prod/test url
* `prices_users_page.dart`: Prices API called using new Prices prod/test url
* `product_prices_list.dart`: Prices API called using new Prices prod/test url
* `product_query.dart`: new Prices prod/test url
* `user_preferences_account.dart`: Prices API called using new Prices prod/test url
* `user_preferences_dev_mode.dart`: new prod/test flag for Prices url
2024-08-12 13:40:25 +02:00
3a4c0c9417 feat: new parameters for uploadProof (#5480)
Impacted files:
* `background_task_add_prices.dart`: 4 new parameters for `uploadProof`
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to off-dart 3.12.0
2024-07-05 17:55:29 +02:00
b3009557ec feat: 5204 - multi-product price addition (#5375)
* feat: 5204 - multi-product price addition

Impacted files:
* `app_en.arb`: added 3 labels and removed one redundant one
* `app_fr.arb`: added 3 labels and removed one redundant one
* `background_task_add_price.dart`: now we manage multiple products, in `List`s
* `price_amount_card.dart`: small UI/UX differences for a single product among several products; minor code simplification
* `price_model.dart`: now we manage multiple products
* `price_product_search_page.dart`: added "no initial product" case
* `product_price_add_page.dart`: now we manage multiple products

* Minor fix
2024-06-14 19:38:13 +02:00
e94d61fa11 feat: 5318 - added a "price privacy warning" dialog (#5343)
Impacted files:
* `app_en.arb`: added 2 labels for the "price privacy warning" dialog
* `background_task_add_price.dart`: now using new off-dart methods
* `knowledge_panel_action_card.dart`: minor off-dart impact
* `price_model.dart`: refactored
* `product_price_add_page.dart`: added the "price privacy warning" dialog the very first time and in an app bar button
* `product_price_item.dart`: now using new off-dart method
* `product_prices_page.dart`: now using new off-dart method
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded of `openfoodfacts` to `3.11.0`
* `user_preferences.dart`: added flag for "price privacy warning"
* `user_preferences_account.dart`: now using new off-dart method
2024-06-08 15:20:43 +02:00
036bda1fec feat: 5301 - added an erasing tool for proofs (#5341)
New files:
* `eraser_model.dart`: Model about the eraser tool: coordinate computations.
* `eraser_painter.dart`:  Painter of the eraser tool: displaying thick lines.

Impacted files:
* `background_task_add_price.dart`: displaying the eraser bars if relevant; new `eraserCoordinates` field
* `background_task_image.dart`: minor refactoring
* `crop_helper.dart`: new `enableEraser` field `offsets` parameters
* `crop_page.dart`: added an erasing tool for proofs; refactored
* `crop_parameters.dart`: new `eraserCoordinates` parameter
* `operation_type.dart` unrelated minor refactoring
* `product_crop_helper.dart`: minor refactoring
* `product_price_item.dart`: unrelated fix for TEST env
* `proof_crop_helper.dart`: minor refactoring
* `pubspec.lock`: wtf
* `pubspec.yaml`: needed upgrade of `crop_image` to `1.0.13`
2024-06-07 09:22:22 +02:00
529fe8f5e1 feat: 5301 - price proofs can be cropped and will be displayed (#5305)
* feat: 5301 - price proofs can be cropped and will be displayed

New files:
* `crop_helper.dart`: Crop Helper for images in crop page: process to run when cropping an image.
* `crop_parameters.dart`: Parameters of the crop operation.
* `product_crop_helper.dart`: Crop Helpers for product images.
* `proof_crop_helper.dart`: Crop Helper for proof images.

Impacted files
* `add_new_product_page.dart`: minor refactoring
* `background_task.dart`: new method `isDeduplicable`
* `background_task_add_price.dart`:
* `background_task_image.dart`: made some methods `static` and public to be reused
* `background_task_manager.dart`: now using new method `isDeduplicable`
* `background_task_upload.dart`: new method `isDeduplicable`
* `crop_page.dart`: refactored using `CropHelper`
* `image_crop_page.dart`: minor refactoring
* `may_exit_page_helper.dart`: minor refactoring
* `price_model.dart`: minor refactoring
* `price_proof_card.dart`: now we may crop the image and we also display the result
* `product_image_crop_button.dart`: refactored using `CropHelper`
* `uploaded_image_gallery.dart`: minor refactoring

* feat: 5301 - fixed WillPopScope2

Impacted files
* `crop_page.dart`: fixed `WillPopScope2`
* `product_price_add_page.dart`: added a `TODO`
* `price_proof_card.dart`: minor refactoring

* Unrelated - fixed `getUrl` bug (was always PROD, never TEST)

New file:
* `signalconso.png`: new asset

Impacted files
* `product_cards_helper.dart`: fixed `getUrl` bug (was always PROD, never TEST)
* `product_image_crop_button.dart`: fixed `getUrl` bug (was always PROD, never TEST)
* `product_image_gallery_other_view.dart`: fixed `getUrl` bug (was always PROD, never TEST)
* `product_image_other_page.dart`: fixed `getUrl` bug (was always PROD, never TEST)
* `uploaded_image_gallery.dart`: fixed `getUrl` bug (was always PROD, never TEST)
2024-05-30 14:34:35 +02:00
db223b5db5 feat: 5195 - new "add one product price" page with background task (#5292)
* feat: 5195 - new "add one product price" page with background task

New files:
* `background_task_add_price.dart`: Background task about adding a product price.
* `currency_selector_helper.dart`: Helper for currency selection.
* `price_amount_card.dart`: Card that displays the amounts (discounted or not) for price adding.
* `price_amount_field.dart`: Text field that displays a single amount for price adding.
* `price_currency_card.dart`: Card that displays the currency for price adding.
* `price_currency_selector.dart`: Button that displays the currency for price adding.
* `price_date_card.dart`: Card that displays the date for price adding.
* `price_location_card.dart`: Card that displays the location for price adding.
* `price_model.dart`: Price Model (checks and background task call) for price adding.
* `price_proof_card.dart`: Card that displays the proof for price adding.
* `product_price_add_page.dart`: Single page that displays all the elements of price adding.

Impacted files:
* `app_en.arb`: added labels related to price adding
* `app_fr.arb`: added labels related to price adding
* `background_task_crop.dart`: minor refactoring
* `background_task_image.dart`: minor refactoring
* `background_task_upload.dart`: minor refactoring
* `currency_selector.dart`: refactored with new class `CurrencySelectorHelper`
* `dao_osm_location.dart`: minor refactoring
* `image_crop_page.dart`: minor refactoring
* `location_list_supplier.dart`: minor refactoring
* `location_map_page.dart`: added action buttons for location description and location confirmation
* `operation_type.dart`: added data for new class `BackgroundTaskAddPrice`
* `prices_card.dart`: now opening new page `ProductPriceAddPage`
* `product_price_item.dart`: minor improvement
* `product_prices_page.dart`: minor improvement
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded `openfoodfacts` to `3.10.0`
* `search_location_preloaded_item.dart`: now enabling the map page to confirm a location

* fine-tuning

Impacted files:
* `app_en.arb`: added labels related to prices
* `app_fr.arb`: added labels related to prices
* `edit_product_page.dart`: added a link to "Add product price" page
* `prices_card.dart`: refactoring
* `product_price_add_page.dart`: fixed the FAB label; refactored the access using a static method
* `product_price_item.dart`: now displaying the not discounted price; refactored
* `product_prices_list.dart`: localized
* `product_prices_page.dart`: added a FAB to "Add product price" page
2024-05-25 19:38:00 +02:00
8758b0e818 fix: 5247 - now "unselect"ing for the correct language (#5266)
Impacted file:
* `background_task_unselect.dart`: use of explicit language instead of default language.
2024-05-25 19:01:58 +02:00
f98bce1977 feat: 4941 - refresh products when switching app language (#5016)
New file:
* `background_task_language_refresh.dart`: Background task about downloading products to translate.

Impacted files:
* `background_task_manager.dart`: minor refactoring
* `dao_product.dart`: new method `getTopProductsToTranslate`
* `local_database.dart`: minor refactoring
* `offline_tasks_page.dart`: minor refactoring
* `operation_type.dart`: new operation type `languageRefresh`
* `product_refresher.dart`: minor refactoring
* `up_to_date_mixin.dart`: minor refactoring
* `up_to_date_product_provider.dart`: minor refactoring
* `user_preferences_language_selector.dart`: now calling new task `BackgroundTaskLanguageRefresh` when changing language
2024-02-24 11:08:58 +01:00
7a81c0c69f feat: 5014 - track all READ server queries when consented (#5057)
* feat: 5014 - track all READ server queries when consented

Impacted files:
* `analytics_helper.dart`: added a public static `isEnabled` method
* `background_task.dart`: now explicitly using the WRITE user
* `background_task_download_products.dart`: now explicitly using the READ user
* `background_task_top_barcodes.dart`: now explicitly using the READ user
* `brand_suggestion_manager.dart`: now explicitly using the READ user
* `ocr_helper.dart`: now explicitly using the READ user
* `paged_product_query.dart`: now explicitly using the READ user
* `product_list_page.dart`: now explicitly using the READ user
* `product_query.dart`: split the user into READ and WRITE users
* `product_refresher.dart`: now explicitly using the READ user
* `random_questions_query.dart`: now explicitly using the READ user
* `simple_input_text_field.dart`: now explicitly using the READ user
* `user_management_provider.dart`: now explicitly using the WRITE user
* `user_preferences_account.dart`: now explicitly using the WRITE user

* minor refactoring

* merge conflicts desperate fix
2024-02-13 20:24:26 +01:00
dc65c00ca6 Ensure the upload confirmation message is centered (#5026) 2024-02-04 09:49:07 +01:00
89cea10a42 feat: 4674 - immediate access to "other" pictures if possible (#4928)
New file:
* `background_task_product_change.dart`: Interface for background tasks that change a product.

Impacted files:
* `background_task_crop.dart`: minor refactoring
* `background_task_details.dart`: minor refactoring, implementing new interface `BackgroundTaskProductChange`
* `background_task_image.dart`: minor refactoring
* `background_task_unselected.dart`: minor refactoring, implementing new interface `BackgroundTaskProductChange`
* `background_task_upload.dart`: minor refactoring, implementing new interface `BackgroundTaskProductChange`
* `product_cards_helper.dart`: new method `getRawProductImages`
* `product_image_gallery_other_view.dart`: now we may have directly the raw images, and if needed we refresh the product instead of fetching specific image ids
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_other_page.dart`: replaced deprecated method
* `product_image_server_button.dart`: now we may have directly the raw images, and if needed we refresh the product instead of fetching specific image ids
* `product_image_viewer.dart`: replaced deprecated method
* `pubspec.lock`: generated
* `pubspec.yaml`: upgraded to off-dart 3.3.0
* `uploaded_image_gallery.dart`: now using `List<ProductImage>` as input
2024-01-25 21:12:34 +01:00
e0b3111596 feat: 4947 - added "download language" to product table (#4951)
Deleted file:
* `dao_product_migration.dart`

Impacted files:
* `background_task_download_products.dart`: added language parameter
* `dao_hive_product.dart`: removed dead code
* `dao_product.dart`: added table column language `lc`
* `local_database.dart`: upgraded the database version
* `onboarding_data_product.dart`: added language parameter
* `product_list_page.dart`: added language parameter
* `product_refresher.dart`: added language parameter
* `query_product_list_supplier.dart`: added language parameter
2024-01-07 18:33:32 +01:00
28262ca1ce fix: 4663 - use the latest password for background tasks + refactoring (#4869)
* fix: 4663 - use the latest password for background tasks + refactoring

Impacted files:
* `background_task.dart`: use the latest password; now we compute user and country from that class, and language most of the time too
* `background_task_barcode.dart`: removed user and country parameters; replaced language
* `background_task_crop.dart`: removed user and country parameters; replaced language
* `background_task_details.dart`: removed user, language and country parameters
* `background_task_download_products.dart`: removed user, language and country parameters
* `background_task_full_refresh.dart`: removed user, language and country parameters
* `background_task_hunger_games.dart`: removed user, language and country parameters
* `background_task_image.dart`: removed user and country parameters; replaced language
* `background_task_offline.dart`: removed user, language and country parameters
* `background_task_paged.dart`: removed user, language and country parameters
* `background_task_progressing.dart`: removed user, language and country parameters
* `background_task_refresh_later.dart`: removed user, language and country parameters
* `background_task_top_barcodes.dart`: removed user, language and country parameters
* `background_task_unselect.dart`: removed user, language and country parameters
* `background_task_upload.dart`: removed user and country parameters; replaced language
* `paged_to_be_completed_product_query.dart`: minor refactoring
* `paged_user_product_query.dart`: minor refactoring

* fix: 4663 - lint fix

---------

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2023-12-21 15:42:50 +01:00
408ef4935e fix: 4870 - more verbose error message for detail background tasks (#4877)
* fix: 4870 - more verbose error message for detail background tasks

* Update packages/smooth_app/lib/background/background_task_details.dart

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* Update packages/smooth_app/lib/background/background_task_details.dart

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

---------

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2023-12-08 12:50:26 +01:00
a6faac096c fix: 4766 - when logging in, show adequate error messages (#4783)
* fix: 4766 - when logging in, show adequate error messages.

New file:
* `login_result.dart`: Result of a log in attempt, more subtle than a `bool`.

Impacted files:
* `app_en.arb`: added 2 labels (network unreachable and server KO)
* `app_fr.arb`: added 2 labels (network unreachable and server KO)
* `background_task_manager.dart`: minor refactoring
* `login_page.dart`: refactored using new class `LoginResult` in order to display more adequate error messages.
* `pubspec.lock`: wtf
* `smooth_app_data_importer.dart`: minor refactoring
* `user_management_provider.dart`: refactored using new class `LoginResult`

* Update packages/smooth_app/lib/pages/user_management/login_page.dart

* Update packages/smooth_app/lib/pages/user_management/login_page.dart

* Update packages/smooth_app/lib/pages/user_management/login_page.dart

* Delete packages/smooth_app/lib/helpers/data_importer/smooth_app_data_importer.dart

no more data_importer
2023-11-17 12:59:21 +01:00
346c6e30c4 fix: 1815 - around context.mounted (#4768)
* fix: 1815 - around context.mounted

The PR is about two related topics:
* Removing all the `ignore: use_build_context_synchronously`
* Replacing all the `State<StatefulWidget> widget` by `BuildContext context`, now that it's possible in flutter

* Update packages/smooth_app/lib/pages/onboarding/permissions_page.dart

* format fix
2023-11-15 11:50:00 +01:00
ba9c3478ef fix: 4725 - refresh of the ios folder for background tasks (#4772)
Impacted files:
* `background_task_crop.dart`: now using new safe method `getFile` instead of just `File`
* `background_task_image.dart`: now using new safe method `getFile` instead of just `File`
* `background_task_upload.dart`: now fixing the ios directory
* `crop_page.dart`: now using a shared directory
2023-11-13 09:05:52 +01:00
4ab2150a60 chore: old TODOs (#4758)
Deleted files:
* `dao_hive_product.dart`: we don't store products in hive since 18 months ago
* `dao_unzipped_product.dart`: we don't store products as unzipped since 18 months ago

Impacted files:
* `background_task_hunger_games.dart`: impacted by off-dart new features
* `background_task_image.dart`: impacted by off-dart new features
* `crop_page.dart`: impacted by off-dart new features
* `local_database.dart`: removed hive and unzipped products
2023-11-04 13:56:58 +01:00
8261f92e5b fix: 4637 - verbose exception with user data (#4741) 2023-10-31 08:27:59 +01:00
2b49c87daf chore: upgrade to off-dart 3.0.0 (#4686)
Impacted files:
* `background_task.dart`: minor refactoring
* `background_task_crop.dart`: added the `UriProductHelper` parameter
* `background_task_details.dart`: added the `UriProductHelper` parameter
* `background_task_download_products.dart`: added the `UriProductHelper` parameter
* `background_task_image.dart`: added the `UriProductHelper` parameter
* `background_task_top_barcodes.dart`: added the `UriProductHelper` parameter
* `background_task_unselect.dart`: added the `UriProductHelper` parameter
* `forgot_password_page.dart`: added the `UriProductHelper` parameter
* `ocr_ingredients_helper.dart`: added the `UriProductHelper` parameter
* `ocr_packaging_helper.dart`: added the `UriProductHelper` parameter
* `onboarding_data_product.dart`: added the `UriProductHelper` parameter
* `ordered_nutrients_cache.dart`: added the `UriProductHelper` parameter
* `paged_product_query.dart`: added the `UriProductHelper` parameter
* `product_cards_helper.dart`: now using an off-dart method
* `product_image_server_button.dart`: added the `UriProductHelper` parameter
* `product_list_import_export.dart`: added the `UriProductHelper` parameter
* `product_list_page.dart`: added the `UriProductHelper` parameter
* `product_query.dart`: added a static `UriProductHelper` that more or less replaces the `QueryType`; minor refactoring
* `product_refresher.dart`: added the `UriProductHelper` parameter
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded off-dart to 3.0.0
* `random_questions_query.dart`: `countries` instead of `country`
* `sign_up_page.dart`: added the `UriProductHelper` parameter
* `temp_product_list_share_helper.dart`: now using a `UriProductHelper`
* `user_management_provider.dart`: added the `UriProductHelper` parameter
* `user_preferences_account.dart`: added the `UriProductHelper` parameter
* `user_preferences_dev_debug_info.dart`: minor refactoring
* `user_preferences_dev_mode.dart`: minor refactoring
2023-10-04 07:37:29 +02:00
c31e4582a4 chore: Migration to Flutter 3.13 (#4579)
Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2023-09-30 19:39:12 +02:00