339 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
f18d6a19b1 fix: 6150 - more generous limit to location look-ups (#6698) 2025-07-02 15:24:29 +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
9208f6612c fix: 6640 - removed misleading "unsupported barcode" scan card (#6659) 2025-06-20 10:01:30 +02:00
cfea953005 feat: Redesign the product page to integrate tabs - M2 (#6356)
Co-authored-by: adriendev <privateadrienps@gmail.com>
Co-authored-by: Adrien MICHEL <developpeuradrien@gmail.com>
Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2025-06-20 09:56:30 +02:00
d9da28d49c fix: 6657 - explicit utf8 data for Photon API (#6658) 2025-06-20 08:07:32 +02:00
98659c8097 Support dark images for the tagline (#6641) 2025-06-10 10:17:59 +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
ebe2af81b4 A valid product needs to have photos (otherwise, we consider it as new) (#6191) 2025-03-03 18:28:57 +01:00
d104a39447 feat: 5411 - now uses nominatim location search if it looks like OSM type/id (#6398)
* feat: 5411 - now uses nominatim location search if it looks like OSM type/id

New files:
* `location_list_nominatim_supplier.dart`: Asynchronously loads locations from Nominatim and OSM ids.
* `location_list_photon_supplier.dart`: Asynchronously loads locations from Photon and query searches.
* `location_osm_type_extension.dart`: Extension on LocationOSMType.

Impacted files:
* `location_list_supplier.dart`: turned class into abstract extended by both photon and nominatim.
* `location_map_page.dart`: now displays the OSM type + id.
* `location_query_model.dart`: now we may use Nominatim search instead of photon search.
* `location_query_page.dart`: minor refactoring

* minor refactoring
2025-02-26 14:45:37 +01:00
097dc91b85 Revert "feat: Product page redesign" (#6332) 2025-02-04 11:17:34 +01:00
90fb5d4c43 Merge branch 'develop' into develop 2025-02-04 08:41:07 +01:00
d5e3032d18 Don't force the product type with custom URLs (#6309) 2025-02-03 17:25:54 +01:00
d8e101666e Languages selector in a modal sheet (#6316) 2025-01-30 16:36:00 +01:00
59cbd305e6 Tab order saved locally 2025-01-29 14:40:40 +01:00
74fe8560be feat: Multi-lingual input for product name + help banner (#6286)
* Explanation banner for the product name

* Bad examples with the wrong title

* Reorder header icons

* Oops… dark mode

* Dark mode x2

* Fix "Nesquik" typo

* With banner

* Remove the warning icon from the Help modal sheet (too ugly)
2025-01-27 08:01:05 +01:00
40ce1fa387 Tagline: support "min_launches" attribute (#6236) 2025-01-19 12:15:14 +01:00
d7a2176122 Silently fail (#6162) 2025-01-10 11:29:57 +01:00
66de046278 Remove the onboarding consent page (#6143) 2025-01-08 13:39:19 +01:00
87b51cca44 Ignore invalid barcodes (#6108) 2025-01-04 11:52:19 +01:00
85c13502d2 Migration to Flutter 3.27 (#6076)
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2024-12-29 15:20:05 +01:00
538e14b04b The access to Robotoff from the Product page is only via the banner (= the button is removed) (#5940) 2024-11-27 18:50:03 +01:00
6c6eae01b6 feat: Min/max version for the tagline (#5917)
* fix: Tagline not refreshing

* Tagline: support min/max version

* Fix: missing items in the `copyWith` method
2024-11-26 19:09:41 +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
3655c3b300 feat: Scan cards share the same UI (#5866)
* Harmonized UI for scan cards

* Update packages/smooth_app/lib/l10n/app_en.arb

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

* Fix build issue

---------

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2024-11-18 15:24:05 +01:00
d6446baeb9 feat: Allow to reorder the action bar (#5826)
* Allow to reorder the action bar

* + vibrations

* +1 more

* Improve the haptic error pattern

* And some vibrations to modal actions

* Remove a visual glitch

* Update packages/smooth_app/lib/l10n/app_en.arb

* fix: Update app_en.arb

* Fix build issue

---------

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2024-11-11 19:23:22 +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
446a8c09d1 feat: 5639 - storing the latest selected product type (#5752)
* feat: 5639 - storing the latest selected product type

Impacted files:
* `search_product_helper.dart`: initialized and set the latest selected product type
* `user_preferences.dart`: new preference field where we store the latest selected product type

* minor fix
2024-10-27 16:16:19 +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
b6af30a584 The tagline content is now hosted on a dedicated Github repo (#5733) 2024-10-25 18:19:18 +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
778b3fbf2a feat: 5586 - explicit call to "food" server for user login actions (#5662)
Impacted files:
* `forgot_password_page.dart`
* `login_result.dart`
* `sign_up_page.dart`
2024-10-03 11:44:52 +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
077bf5ef8c feat: 5586 - OxF filter for term searches (#5637)
Impacted files:
* `category_product_query.dart`: refactored with new `productType` parameter
* `keywords_product_query.dart`: refactored with new `productType` parameter
* `paged_product_query.dart`: refactored with new `productType` parameter
* `paged_search_product_query.dart`: refactored with new `productType` parameter
* `paged_to_be_completed_product_query.dart`: refactored with new `productType` parameter
* `paged_user_product_query.dart`: refactored with new `productType` parameter
* `product_list.dart`: refactored with new `productType` parameter
* `product_query.dart`: added a "get label" method for `ProductType`
* `search_field.dart`: displayed the new optional "additional filter" (e.g. OxF)
* `search_helper.dart`: added a new optional "additional filter"
* `search_product_helper.dart`: new "product type filter" widget
* `summary_card.dart`: minor "productType" fix
* `user_preferences_account.dart`: added "productType.food" to user page counts
* `user_preferences_contribute.dart`: added "productType.food" to "to be completed" products
2024-09-27 22:40:14 +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
8e5ea75f61 feat: 5568 - optimized search for price locations (#5587)
Impacted files:
* `app_en.arb`: added a label for "location broader search"
* `app_fr.arb`: added a label for "location broader search"
* `dao_osm_location.dart`: added columns osmKey and osmValue
* `local_database.dart`: upgraded the version in order to add columns to location table
* `location_list_supplier.dart`: added optional parameters for optimized search; added fields osmKey and osmValue
* `location_query_model.dart`: now we use 2 suppliers - optimized and broader
* `location_query_page.dart`: now display optimized results first, then broader results after a button click
* `osm_location.dart`: added fields osmKey and osmValue
2024-09-25 10:38:08 +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
a797ebde6d feat: Add the outdated indicator to the photo grid (#5491)
* Add the outdated indicator to the photo grid

* Add some comments
2024-07-22 12:13:01 +02:00
ca749bca0d Save the date when the language is changed (#5443) 2024-07-04 15:30:37 +02:00
b2fbb75574 Allow the URL of a translated image to be null (#5446) 2024-07-04 15:30:05 +02:00
b110334c3d feat: A feedback form for the prices page (#5442)
* A feedback form for the prices page

* Fix
2024-06-25 08:22:11 +02:00
ba8313c0b2 Depending of the state of preferences, the onboarding exit may fail (#5433) 2024-06-22 09:40:37 +02:00
60a898f51e chore: Remove Scan Example page from the onboarding (#5420)
* Remove Scan Example page from the onboarding

* Remove unused translation
2024-06-21 17:15:36 +02:00
4deb0b42a4 fix: 2 bugfixes for the tagline (empty content + image in error) (#5421)
* If for some reason, there is no news, we shouldn't display the tagline at all

* If the image can't be loaded, we hide it
2024-06-20 18:58:26 +02:00
274d797d8b Dev mode for app news: custom URI + manual refresh (#5416) 2024-06-20 17:26:29 +02:00
93d460cc23 Improve accessibility on the homepage (#5412) 2024-06-19 13:15:34 +02:00
6026fbc91b fix: Fix issues with themes (#5410)
* Fix issues with themes

* Reformat code
2024-06-19 10:07:31 +02:00