64 Commits

Author SHA1 Message Date
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
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
281d803942 feat: 6523 - upgrade to l10n_countries (#6653) 2025-06-20 10:00:23 +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
d5e3032d18 Don't force the product type with custom URLs (#6309) 2025-02-03 17:25:54 +01:00
736f08c8ac feat: 6025 - settings for the folksonomy server (#6027)
Impacted files:
* `folksonomy_provider.dart`: used a specific folksonomy server instead of systematically the prod server
* `product_query.dart`: specific folksonomy server
* `user_preferences_dev_mode.dart`: settings for the specific folksonomy server
2024-12-12 18:04:59 +01:00
3aadddf0f9 feat: upgrade to off-dart 3.18.0 (#5973)
Impacted files:
* `osm_location.dart`: minor refactoring due to 3.18.0 - now we may have proofs without osm location (e.g. internet)
* `price_model.dart`: minor refactoring due to 3.18.0 - now we may have proofs without osm location (e.g. internet)
* `product_query.dart`: added the `OWNER` product field to be retrieved
* `product_refresher.dart`: now we use only the `food` server for single barcode queries, but with `ProductTypeFilter.all`
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to off-dart 3.18.0
2024-11-30 13:56:51 +01:00
f81af45047 feat: Change UI of new product type cards (#5857) 2024-11-23 09:26:54 +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
2bffec147e Photo gallery with tabs (#5872) 2024-11-18 13:24:40 +01:00
bab4fd879b feat: 5638 - 5 dimensions for matomo (#5837)
* feat: 5638 - 5 dimensions for matomo

Impacted files:
* `add_basic_details_page.dart`: minor refactoring
* `add_new_product_page.dart`: using new method `trackProductEvent`
* `add_other_details_page.dart`: minor refactoring
* `analytics_helper.dart`: new method `trackProductEvent`; added 5 dimensions to matomo event track methods
* `attribute_first_row_helper.dart`: minor refactoring
* `barcode_product_query.dart`: using new method `trackProductEvent`
* `edit_new_packagings.dart`: minor refactoring
* `edit_ocr_page.dart`: minor refactoring
* `edit_product_page.dart`: minor refactoring
* `new_product_footer.dart`: using new method `trackProductEvent`
* `nutrition_page_loaded.dart`: minor refactoring
* `product_field_editor.dart`: minor refactoring
* `product_image_gallery_view.dart`: minor refactoring
* `product_incomplete_card.dart`: using new method `trackProductEvent`
* `product_questions_widget.dart`: using new method `trackProductEvent`
* `simple_input_page.dart`: minor refactoring
* `summary_card.dart`: using new method `trackProductEvent`

* minor refactoring

* minor refactoring
2024-11-12 14:27:27 +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
66a3492531 feat: 5621 - "road to scores" label now depends on OxF (#5772)
Impacted files:
* `app_en.arb`: added labels for OxF versions
* `product_incomplete_card.dart`: button label depends on OxF
* `product_query.dart`: new `getRoadToScoreLabel` method
2024-11-01 14:58:15 +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
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
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
57d2d07afa chore: upgrade to off-dart 3.13 (#5555)
Impacted files:
* `product_query.dart`: added the new "owner_fields" field
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgrade to off-dart 3.13
2024-08-30 19:44:25 +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
fe0313910b chore: Upgrade dependencies (#5490)
* Upgrade dependencies

* Downgrade audioplayers

* Remove Lint warning

* Bring back pupspec.lock

* Also bring devtools_options.yaml
2024-07-23 09:54:45 +02:00
5f7966c7f8 feat: 5201 - change currency with country when relevant (#5238)
* feat: 5201 - change currency with country when relevant

Impacted files:
* `app_en.arb`: message for a "change currency too?" dialog
* `country_selector.dart`: new method to change the currency at the same time as the country if relevant
* `product_query.dart`: init currency if null
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded `openfoodfacts` to `3.8.0`
* `user_preferences_country_selector.dart`: asking to change the currency at the same time as the country only if confirmed or relevant
* `welcome_page.dart`: explicitly asking to change the currency at the same time as the country

* refactoring

* minor changes about labels
2024-05-11 14:38:13 +02: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
432e9bbf0d feat: 5005 - "obsolete product" matomo event (#5042)
* feat: 5005 - "obsolete product" matomo event

Impacted files:
* `analytics_helper.dart`: added an "obsolete product" matomo event
* `barcode_product_query.dart`: sent an "obsolete product" matomo event when relevant
* `product_query.dart`: added the new OBSOLETE product field to the fields we retrieve
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to openfoodfacts 3.4.0

* refactor: now using AutocompleteManager
2024-02-12 18:51:51 +01:00
542c4c21c6 feat: 4836 - clickable link to "open new issue" when relevant (#4875)
* feat: 4836 - clickable link to "open new issue" when relevant

Impacted files:
* `app_en.arb`: added an "open new issue if relevant" label.
* `app_fr.arb`: added an "open new issue if relevant" label.
* `loading_dialog.dart`: added an optional `shouldOpenNewIssue` parameter with appropriate display
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded openfoodfacts to 3.2.1
* `sign_up_page.dart`: use the new `shouldOpenNewIssue` parameter when server error

* lint fixes
2023-12-12 20:17:16 +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
d8042224f3 fix: 4575 - country is now always populated (#4591)
* fix: 4575 - country is now always populated

* Update packages/smooth_app/lib/query/product_query.dart

* fix: 4575 - reformatted
2023-08-26 17:11:53 +02:00
369f14599c feat: 4554 - new links in FAQ (#4572)
* feat: 4554 - new links in FAQ

Impacted files:
* `app_en.arb`: added labels for the 9 new items
* `app_fr.arb`: added labels for 4 new items
* `user_preferences_faq.dart`: added 9 items; fixed 2 items
* `product_query.dart`: new `replaceSubdomain` method

* feat: 4554 - new icons for app install

Impacted files:
* `RVB_ICON_BLACK_BG_OBF.svg`: dark version of Beauty app icon
* `RVB_ICON_BLACK_BG_OPF.svg`: dark version of Product app icon
* `RVB_ICON_BLACK_BG_OPFF.svg`: dark version of Pet Food app icon
* `RVB_ICON_WHITE_BG_OBF.svg`: light version of Beauty app icon
* `RVB_ICON_WHITE_BG_OPF.svg`: light version of Product app icon
* `RVB_ICON_WHITE_BG_OPFF.svg`: light version of Pet Food app icon
* `user_preferences_faq.dart`: new icons for app install, dark and light

* feat: 4554 - new icon layout

Impacted file:
* `user_preferences_faq.dart`: all icons are now centered on a 48x48 square, the real icons have the standard size, and the svg icons have a width of 48

* feat: 4554 - new 5 items for the contact page

Impacted files:
* `app_en.arb`: added labels for the new 5 items
* `user_preferences_connect.dart`: added 5 items
* `user_preferences_faq.dart`: minor refactoring
2023-08-19 10:17:18 +02:00
f79bae611f feat: 4423 - specific "Not connected to internet" displayed error (#4455)
* feat: 4423 - specific "Not connected to internet" displayed error

Impacted files:
* `barcode_product_query.dart`: removed useless `try` as already `catch`'ed
* `continuous_scan_model.dart`: removed the `codeInvalid` case that could never happen
* `fetched_product.dart`: refactored with explicit constructors and additional exception and connectivity fields; removed the `codeInvalid` case that could never happen
* `new_product_page.dart`: minor refactoring
* `product_dialog_helper.dart`: removed the `codeInvalid` case that could never happen; minor refactoting
* `product_list_item_simple.dart`: removed the `codeInvalid` case that could never happen
* `product_loader_page.dart`: removed useless `try` as already `catch`'ed
* `product_refresher.dart`: added a specific "You're not connected to the internet" error message; refactored using more `FetchedProduct`; removed useless method
* `pubspec.lock`: wtf
* `pubspec.yaml`: added package `connectivity_plus`
* `question_card.dart`: refactored using `FetchedProduct`

* feat: 4423 - fixed pubspec.yaml

* feat: 4423 - new "server down" message after a ping attempt

Impacted files:
* `fetched_product.dart`: added field `failedPingedHost` where we store the host that we couldn't ping
* `generated_plugin_registrant.cc`: wtf
* `generated_plugins.cmake`: wtf
* `GeneratedPluginRegistrant.swift`: wtf
* `main.dart`: registered `DartPingIOS`
* `product_refresher.dart`: now trying to ping the server if exception and connection
* `pubspec.lock`: wtf
* `pubspec.yaml: added packages `dart_ping` and `dart_ping_ios`

* feat: 4423 - stupid lint check part 1

* feat: 4423 - stupid lint check part 2

* feat: 4423 - stupid lint check part 3

* feat: 4423 - stupid lint check part 5

* feat: 4423 - localizations

Impacted files:
* `app_en.arb`: 4 new labels when we couldn't retrieve a product (not found, no internet, server down, server error)
* `product_refresher.dart`: used the new labels
2023-08-16 12:01:25 +02:00
78884a6ad2 feat: App review in the "scan card" (#4450)
* App review in the "scan card"

* Add a keep alive to prevent many requests

* Add a missing call to super (for the KeepAlive mixin)

* Don't really understand what happened with this file 🤨
2023-08-05 17:27:59 +02:00
79ec954472 fix: 4122 - added a country filter for hunger games (#4168)
Impacted files:
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to off-dart 2.6.0
* `random_questions_query.dart`: added a country filter for hunger games
2023-06-15 19:36:23 +02:00
7002a123a4 feat: Migration to Flutter 3.10 (#4142)
* Migration to Flutter 3.10

* Bump Flutter version on actions

* GitHub Actions: use channel instead of a fixed version of Flutter

* Add a missing argument due to the upgrade to Flutter 3.10

* Regenerate goldens

---------

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2023-06-14 18:33:22 +02:00
55b4894edb fix: 4066 - predownload and top 1K download as background tasks (#4131)
Deleted file:
* `products_preload_helper.dart`

New files:
* `background_task.dart`: Abstract background task.
* `background_task_full_refresh.dart`: Background task about refreshing all the already downloaded products.
* `background_task_offline.dart`: Background task about pre-downloading top n products for offline usage.

Impacted files:
* `background_task_barcode.dart`
* `background_task_crop.dart`: refactored
* `background_task_details.dart`: refactored
* `background_task_hunger_games.dart`: refactored
* `background_task_image.dart`: refactored
* `background_task_manager.dart`
* `background_task_refresh_later.dart`: refactored
* `background_task_unselect.dart`: refactored
* `background_task_upload.dart`: refactored
* `offline_data_page.dart`: now using background task for offline and full refresh tasks
* `offline_tasks_page.dart`: dealing with the "no barcode" case
* `operation_type.dart`: added values `offline` and `fullRefresh`; added `processName` field; added a `BackgroundTask` constructor
* `product_refresher.dart`: bug fix
2023-06-13 23:45:37 +02:00
af9f28bf2c feat: 4102 - bigger hunger games batch (10) (#4104)
Impacted files:
* `app_en.arb`: added the "next n questions" label for hunger games
* `app_fr.arb`: added the "next n questions" label for hunger games
* `congrats.dart`: "continue" button label as a String parameter
* `product_questions_query.dart`: added a `count` parameter
* `product_questions_widget.dart`: added the `count` parameter
* `question_page.dart`: different `count` parameters; set the "continue" button label
* `questions_query.dart`: added a `count` parameter
* `random_questions_query.dart`: added a `count` parameter
* `robotoff_insight_helper.dart`: added the `count` parameter
2023-06-09 14:32:15 +02:00
cb815b0cac feat: 4020 - instant answers for hunger games (#4099)
* feat: 4020 - instant answers for hunger games

New files:
* `background_task_hunger_games.dart`: Background task about answering a hunger games question.
* `random_questions_query.dart`: Robotoff questions helper, for random product questions.

Deleted file:
* `product_question_page.dart`

Impacted files:
* `abstract_background_task.dart`: added "hunger games"
* `background_task_crop.dart`: minor refactoring
* `background_task_details.dart`: minor refactoring
* `background_task_image.dart`: minor refactoring
* `background_task_manager.dart`: simplified the code, as we now always work on tasks with different stamps
* `background_task_refresh.dart`: minor refactoring
* `background_task_unselect.dart`: minor refactoring
* `new_product_page.dart`: minor refactoring
* `offline_data_page.dart`: minor refactoring
* `operation_type.dart`: added a type for "hunger games" background task
* `product_list_import_export.dart`: minor refactoring
* `product_list_page.dart`: minor refactoring
* `product_questions_query.dart`: pre-loads the product if relevant
* `product_questions_widget.dart`: minor refactoring
* `product_refresher.dart`: new standard configuration for product lists; new silent download of product lists; minor refactoring
* `question_card.dart`: now downloading the product only if not in the local database
* `question_page.dart`: now saving the answer with background tasks; refactored
* `questions_query.dart`: refactored as abstract, with code moved to new file `random_questions_query.dart`
* `robotoff_insight_helper.dart`: minor refactoring

* feat: 4020 - unrelated package upgrade

* fix: 4098 - new enum value from iOS 12
2023-06-08 18:13:48 +02:00
e1a2afe1ed fix: 4056 - fixed List syntax for offline data (#4059)
* fix: 4056 - fixed List syntax for offline data

* Additional fix
2023-06-02 13:26:18 +02:00
fb164cbce2 feat: 3835 - country selector similar to language selector (#3936)
Impacted files:
* `consent_analytics_page.dart`: minor refactoring
* `country_selector.dart`: now using the preferences for initial country code; same UI as language selector
* `main.dart`: minor refactoring
* `next_button.dart`: minor refactoring
* `onboarding_flow_navigator.dart`: refactoring around `OnboardingPage`
* `permissions_page.dart`: minor refactoring
* `product_query.dart`: minor refactoring
* `user_preferences.dart`: minor refactoring
* `user_preferences_dev_mode.dart`: minor refactoring
* `user_preferences_page.dart`: minor UI fix (app bar title on 2 lines)
* `user_preferences_settings.dart`: added the "selected language" parameter; minor refactoring
* `welcome_page.dart`: fixed a visual overflow bug
2023-05-07 08:04:51 +02:00
e5bf1cbc0d feat: 3897 - ingredients and packaging with mulitlingual OCR image+text (#3911)
New file:
* `multilingual_helper.dart`: Helper for multilingual inputs (e.g. product name).

Deleted file:
* `ocr_widget.dart`: moved code to `edit_ingredients_page.dart`, for better state refresh

Impacted files:
* `add_basic_details_page.dart`: refactored with new class `MultilingualHelper`
* `edit_ingredients_page.dart`: added multilingual management; moved code from `ocr_widget.dart`
* `ocr_helper.dart`: refactored with multilingual management
* `ocr_ingredients_helper.dart`: refactored with multilingual management
* `ocr_packaging_helper.dart`: refactored with multilingual management
* `product_query.dart`: added multilingual ingredients field; removed duplicate field
2023-04-27 15:47:03 +02:00
9679de7fda feat: 3897 - now we display localized images (#3900)
Impacted files:
* `background_task_crop.dart`: added language to transient file key
* `background_task_image.dart`: added language to transient file key
* `background_task_unselect.dart`: unrelated removal of not used fields
* `edit_ingredients_page.dart`: now we display localized images
* `image_upload_card.dart`: added language to transient file key
* `ocr_widget.dart`: added language to transient file key
* `product_cards_helper.dart`: now returns a localized image; refactored; new method `getLocalizedProductImageUrl`
* `product_image_carousel.dart`: now we display localized images
* `product_image_gallery_view.dart`: now we display localized images
* `product_image_swipeable_view.dart`: now we display localized images
* `product_image_viewer.dart`: now we display localized images
* `product_query.dart`: unrelated removal of not used field
* `product_refresher.dart`: unrelated minor refactoring
* `smooth_product_image.dart`: now we display localized images
* `transient_file.dart`: added language to transient file key
* `up_to_date_changes.dart`: unrelated removal of not used fields
2023-04-24 18:58:32 +02:00
d8a5fb5fbb chore: ProductQuery.getLanguage() is now not nullable (#3896) 2023-04-24 11:43:38 +02:00
011336f0eb feat: 3863 - multilingual input for product name (#3890)
* feat: 3863 - language selector refactoring

Impacted files:
* `language_selector.dart`: moved code to new static method `openLanguageSelector`
* `user_preferences_languages_list.dart`: minor refactoring
* `user_preferences_settings.dart`: minor refactoring

* feat: 3863 - language selector with preselections

Impacted files:
* `language_selector.dart`: added the concept of "pre selected languages" and their different displays
* `product_query.dart`: added a `TODO`
* `user_preferences_settings.dart`: minor refactoring

* feat: 3863 - multilingual input for product name

Impacted files:
* `add_basic_details_page.dart`: introduced the multilingual input
* `language_selector.dart`: added an optional "displayed language" parameter, useful for `AddBasicDetailsPage`
* `product_query.dart`: now we download the `NAME_ALL_LANGUAGES` product field too
* `up_to_date_changes.dart`: now we manage the `productNameInLanguages` product field too
2023-04-21 17:35:15 +02:00
26b456e2c0 chore: upgraded to off-dart 2.5.0 (#3876) 2023-04-21 10:51:37 +02:00
c5871a7583 fix: 3600 - user may be null for robotoff random questions (#3758)
Impacted files:
* `pubspec.lock`: wtf
* `pubspec.yaml`: used new version of off-dart, with optional user for robotoff random questions
* `questions_query.dart`: the user may be null
2023-03-08 21:53:54 +01:00
8b38a72be7 feat: 2484 - now when editing we go to the full image with the cropped area on top (#3658)
Impacted files:
* `app_en.arb`: added a label for the "send image" button (instead of vague "confirm")
* `background_task_crop.dart`: added a product change where we store the crop parameters
* `background_task_image.dart`: added a fake product change where we remove the crop parameters
* `new_crop_page.dart`: added constructor parameters `initialCropRect` and `initialRotation`; removed the "new photo" button for UI/UX consistency
* `product_image_viewer.dart`: refactored with 2 or 4 buttons and cleaner code
* `product_query.dart`: added `IMAGES` product field
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded `openfoodfacts` to `2.2.1` (about `ProductImage`)
* `rotation.dart`: added method `fromDegrees`
* `up_to_date_changes.dart`: added `images` to "overwritable" product fields; now accepts all operation types
2023-01-30 20:16:05 +01:00
994078bef1 feat: 3505 - packagingsComplete toggle and packagings edit bug fixes (#3513)
Impacted files:
* `app_en.arb`: added a label about "packaging complete"
* `background_task_details.dart`: added field `packagingComplete`
* `edit_new_packagings.dart`: added a `packagingComplete` editor; fixed a bug by populating the controllers at init time and not on demand; now disposes the controllers; aligned the titles
* `product_query.dart`: added field `PACKAGINGS_COMPLETE`
* `up_to_date_changes.dart`: added field `packagingComplete`
2023-01-04 11:53:25 +01:00
7e861f569e refactor: upgrade to off-dart 2.0.0 (#3495)
Impacted files:
* `paged_to_be_completed_product_query.dart`: renamed `State` as `ProductState`
* `paged_user_product_query.dart`: created local `UserSearchType` instead of deprecated off-dart `UserProductSearchType`; used `ProductSearchQueryConfiguration` instead of deprecated `UserProductSearchQueryConfiguration`
* `product_query.dart`: now that we use fully v3, we don't need the temporary field list for user-related queries with v2
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgrade to off-dart 2.0.0
* `user_preferences_account.dart`: now using new local class `UserSearchType`
* and reduced all off-dart imports to a single `import 'package:openfoodfacts/openfoodfacts.dart';`
2023-01-02 16:10:52 +01:00
09a982a1f1 feat: 3430 - new packagings edit page based on api v3 (#3475)
* feat: 3430 - new packagings edit page based on api v3

New file:
* `edit_new_packagings.dart`: Edit display of a product packagings (the new api V3 version).

Impacted files:
* `background_task_details.dart`: added specific save method call for api V3
* `edit_product_page.dart`: added call to new page `EditNewPackagings`
* `ocr_packaging_helper.dart`: minor unrelated refactoring
* `paged_user_product_query.dart`: specific field list
* `product_query.dart`: upgraded to api V3; added field `PACKAGINGS`; added specific field list for user-related searches (they do not support `PACKAGINGS`)
* `product_refresher.dart`: upgraded to api V3
* `simple_input_page.dart`: minor refactoring
* `simple_input_widget.dart`: refactoring about making the autocomplete widget reusable
* `up_to_date_changes.dart`: added new field `packagings`; minor unrelated refactoring

* Update packages/smooth_app/lib/pages/product/edit_product_page.dart

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

* feat: 3430 - dart format

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2022-12-27 22:05:59 +01:00
390f859782 refactor: integrating off-dart 1.30.1 (#3471)
* refactor: integrating off-dart 1.30.1

Impacted files:
* `background_task_details.dart`: minor refactoring
* `background_task_image.dart`: minor refactoring
* `background_task_refresh_later.dart`: minor refactoring
* `country_selector.dart`: minor refactoring
* `new_product_page.dart`: minor refactoring
* `ocr_packaging_helper.dart`: minor refactoring
* `offline_data_page.dart`: now using an explicit api version
* `ordered_nutrients_cache.dart`: minor refactoring
* `paged_search_product_query.dart`: now using an explicit api version
* `paged_to_be_completed_product_query.dart`: now using an explicit api version
* `Podfile.lock`: wtf
* `product_image_data.dart`: minor refactoring
* `product_list.dart`: minor refactoring
* `product_list_import_export.dart`: now using an explicit api version
* `product_list_page.dart`: now using an explicit api version
* `product_query.dart`: explicit api version
* `product_query_page.dart`: minor refactoring
* `product_refresher.dart`: now using an explicit api version
* `products_preload_helper.dart`: now using an explicit api version
* `app/pubspec.lock`: wtf
* `smooth_app/pubspec.lock`: wtf
* `pubspec.yaml`: upgraded off-dart version to 1.30.1
* `up_to_date_changes.dart`: minor refactoring

* refactor: fix 3470

Impacted file:
* `user_preferences_account.dart`: now logging error and displaying nothing if cannot count, and optimized the code
2022-12-27 08:15:53 +01:00
48745c8afd chore: Dev mode cleanup (#3452)
* chore: Dev mode cleanup

* Update user_preferences_dev_debug_info.dart

* Update plural_translation_test.dart

* Update product_query.dart

* Update user_preferences_dev_debug_info.dart

* Copy to clipboard

* Update user_preferences_dev_debug_info.dart
2022-12-23 11:10:50 +01:00
d6dc91d0b7 fix: Language code usage (#3450)
* fix: Language code usage

* Update main.dart

* Fix for local != lc

* Update product_preferences.dart

* Update main.dart

* Fix tagline

* Update tagline.dart
2022-12-23 10:02:14 +01:00
be3a2ed43a feat: 3207 - now displays a card for product website, if available (#3369)
Impacted files:
* `app_en.arb`: added 1 label for "website field title"
* `app_fr.arb`: added 1 label for "website field title"
* `new_product_page.dart`: now displays a card for website, if available
* `product_query.dart`: added "website" product field
2022-11-28 09:38:18 +01:00