81 Commits

Author SHA1 Message Date
5186bc6cda Minor improvements (#6146) 2025-01-07 14:14:59 +01:00
4db7eaa9ed Minor onboarding improvements (#6126) 2025-01-06 20:21:44 +01:00
43d282a241 fix: 5 bugfixes (icons color, better network mgmt / Japanese…) (#6127)
* Fix the elevated button color

* Scan tagline : when there is an error, hide the image

* Better management of errors for the `ProductPicture`

* Force a loader for the gallery

* Fix Japanese issue with tables

* Update packages/smooth_app/lib/cards/product_cards/smooth_product_image.dart

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>

* Force a color for Price buttons

---------

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2025-01-06 08:52:08 +01:00
454060e6c0 Better selection area (#6113) 2025-01-04 11:51:51 +01:00
7a02b57fd0 feat: Disable gestures on the KP map (#6081)
* Disable gestures on the KP map

* World map

* Remove warning
2024-12-30 08:12:57 +01:00
f53938c8e9 feat: Improve KP tables layout (#6080)
* Improve KP tables

* Cache horizontalDivider

* Some comments

* Improvements for dropdown

* no message
2024-12-29 22:58:48 +01:00
edf16ddb07 chore: 5944 - systematically using "upToDateProduct" (#5951)
Impacted files:
* `edit_ocr_page.dart`: replaced "widget.product" with "upToDateProduct"; used "barcode" getter
* `knowledge_panel_page.dart`: replaced "widget.product" with "upToDateProduct"
* `nutrition_page_loaded.dart`: replaced "widget.product" with "upToDateProduct"
* `product_image_gallery_view.dart`: replaced "widget.product" with "upToDateProduct"
* `product_image_swipeable_view.dart`: replaced "widget.product" with "upToDateProduct"
2024-11-28 09:42:41 +01:00
453bf9e64f Knowledge Panel background color in light mode + product name (#5920) 2024-11-24 14:11:39 +01:00
688ddc214f feat: Improvements for the product page (Part 2) (#5764)
* Improvements for the product page

* Fix Android issues

* Remove unused variable
2024-10-28 21:57:31 +01:00
b07b942076 feat: Action bar for the product (+ light redesign) (#5749)
* Light redesign for the Product page + action bar

(cherry picked from commit cb50d79ce66aacdb729b44c94e061112db3b3aa3)

* Remove unused variable

* Update Sketch file
2024-10-27 20:00:17 +01:00
29f433c806 feat: 5700 - no click for KP title without additional elements (#5709)
Impacted files:
* `knowledge_panel_card.dart`: overrides the "isClickable" parameter in case there are eventually no further elements to display
* `knowledge_panels_builder.dart`: new helper methods
2024-10-20 14:16:33 +02:00
3185c72a36 fix: 5665 - display "add nutrition facts" button only for relevant types (#5674)
Impacted files:
* `add_nutrition_button.dart`: new method to check if nutrition facts are relevant for this product type
* `knowledge_panel_action_card.dart`: checks if the product type matches before displaying the nutrition facts button
* `knowledge_panels_builder.dart`: checks if the product type matches before displaying the nutrition facts button
* `pubspec.lock`: upgrade to flutter `3.24`
2024-10-20 08:40:26 +02:00
3c12fe0245 feat: 5643 - removed irrelevant editors for non-FOOD products (#5663)
Impacted files:
* `add_new_product_page.dart`: editors different when not FOOD; minor refactoring
* `edit_product_page.dart`: no ingredient editor for PRODUCTS
* `image_field_extension.dart`: now the main image fields depend on product type; minor refactoring (more compact `switch` syntax)
* `knowledge_panels_builder.dart`: minor fix
* `product_cards_helper.dart`: now the main image fields depend on product type
* `product_image_gallery_view.dart`: now the main image fields depend on product type
* `product_image_swipeable_view.dart`: now the main image fields depend on product type
2024-10-04 10:15:13 +02:00
ddb127d4cd Remove flutter map attribution (#5511) 2024-07-30 08:54:18 +02:00
a3e9bc24ec refactor: Rename tagline* to AppNews (#5377)
* Rename `tagline*` to `AppNews`

* Fix labeler path
2024-06-16 17:39:33 +02:00
41abf730fe feat: Tagline V3 (#5350)
* New JSON

* Tagline V3

* Refresh the tagline on language change

* Fix Lint errors

* Revert `SmoothScaffold` changes

* Filter news with startDate/endDate
2024-06-10 15:19:24 +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
44e4774936 feat: Knowledge Panel details page accessibility improvements (#5290)
* KP page accessibility improvements

* ScoreCardType as a public enum
2024-05-25 17:15:03 +02:00
db20b51cb6 feat: 5191 - knowledge panel image card now clickable (#5220)
Impacted files:
* `knowledge_panel_image_card.dart`: now using the optional `linkUrl` field for click operation
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to off-dart 3.7.0
2024-05-05 12:34:40 +02:00
11b1212d4f refactor: 5075 - explicit localization of OFF world links (#5076)
* refactor: 5075 - explicit localization of OFF world links

Impacted files:
* `external_page.dart`: removed useless parameter
* `knowledge_panel_text_card.dart`: removed useless parameter
* `knowledge_panel_world_map_card.dart`: removed useless parameter
* `launch_url_helper.dart`: removed useless parameter; removed redundant method
* `loading_dialog.dart`: removed useless parameter
* `login_page.dart`: removed useless parameter
* `new_product_page.dart`: removed useless parameter
* `smooth_html_widget.dart`: removed useless parameter
* `smooth_product_carousel.dart`: removed useless parameter
* `user_preferences_account.dart`: explicitly localized the OFF world subdomain
* `user_preferences_connect.dart`: removed useless parameter
* `user_preferences_contribute.dart`: removed useless parameter
* `user_preferences_faq.dart`: explicitly localized the OFF world subdomain; removed useless parameter
* `website_card.dart`: removed useless parameter

* Update user_preferences_faq.dart

Removed one parameter.
2024-02-20 06:55:46 +01:00
91212a98bf Remove the package name from the quick tile (#4985) 2024-01-15 13:02:14 +01:00
735ae8cf47 fix: If a "panel summary widget" is incomplete, the app shouldn't crash (#4987)
* In the case where a "panel summary widget" is null, we have to pass a non-null WIdget

* Add a missing `const`
2024-01-15 13:00:53 +01:00
465060c7c3 Add some debug info to Knowledge Panels (#4960) 2024-01-09 12:00:45 +01:00
c485ebf793 chore: old TODOs (#4886)
Impacted files:
* `knowledge_panel_world_map_card.dart`: handled the "multi geo" case; fixed the geo marker alignment
* `permission_helper.dart`: removed comment
* `pubspec.lock`: wtf
* `pubspec.yaml`: added package `email_validator`
* `svg_safe_network.dart`: minor refactoring
* `user_management_helper.dart`: now using package `email_validator`
* `user_preferences.dart`: replaced hard-coded string with const
* `user_preferences_attribute_group.dart`: removed dead code
2023-12-12 13:11:06 +01:00
60971d1344 feat: 4628 - new "reorder KP" feature from dev mode (#4778)
New files:
* `reorderable_knowledge_panel_page.dart`: Page where the user can reorder the Knowledge Panel Cards.
* `reordered_knowledge_panel_cards.dart`: Knowledge Panel Cards as reordered by the user.
* `standard_knowledge_panel_page.dart`: Knowledge Panel Cards as provided by the server.

Impacted files:
* `app_en.arb`: added a "reorder the attributes" label
* `knowledge_panel_card.dart`: added an `isClickable` parameter to be get rid of the click icon+effect when reordering attributes
* `knowledge_panel_expanded_card.dart`: added an `isClickable` parameter
* `knowledge_panel_group_card.dart`: added an `isClickable` parameter
* `knowledge_panel_page.dart`: explicitly setting `isClickable: true`
* `knowledge_panels_builder.dart`: added an `isClickable` parameter
* `new_product_page.dart`: now using a dev-mode flag to determine if we display the reorder feature; moved code to new class `StandardKnowledgePanelCards`
* `pubspec.lock`: wtf
* `score_card.dart`: unrelated minor refactoring
* `user_preferences.dart`: added the user ordered attribute list as preference
* `user_preferences_dev_mode.dart`: added a flag for user reordered attribute feature
2023-12-08 16:25:44 +01:00
0ddd5c6538 chore: upgraded flutter_map to 6.0.1 (#4757)
* chore: upgraded flutter_map to 6.0.1

Impacted files:
* `add_new_product_page.dart`: matomo upgrade
* `analytics_helper.dart`: matomo upgrade
* `camera_scan_page.dart`: matomo upgrade
* `forgot_password_page.dart`: matomo upgrade
* `knowledge_panel_page.dart`: matomo upgrade
* `knowledge_panel_world_map_card.dart`: flutter_map upgrade
* `login_page.dart`: matomo upgrade
* `main.dart`: matomo upgrade
* `new_product_page.dart`: matomo upgrade
* `personalized_ranking_page.dart`: matomo upgrade
* `product_list_page.dart`: matomo upgrade
* `product_query_page.dart`: matomo upgrade
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded flutter_map to 6.0.1 (+ domino effect)
* `question_page.dart`: matomo upgrade
* `sign_up_page.dart`: matomo upgrade
* `user_preferences_page.dart`: matomo upgrade

* chore: upgrade flutter_map to 6.0.1

Impacted file:
* `mocks.dart`: matomo upgrade

* chore: unit test fix

* pubspec upgrade
2023-11-17 12:50:35 +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
b3f73c061b chore: upgrade to flutter_map 4.0.0 (#4752)
Impacted files:
* `knowledge_panel_world_map_card.dart`: recoded with flutter_map 4.0.0 syntax
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to flutter_map 4.0.0
2023-11-01 02:20:35 +01:00
e463ca37a8 feat: 4628 - refactoring as preparatory work (#4641)
* feat: 4628 - refactoring

Deleted files:
* `knowledge_panel_element_card.dart`
* `knowledge_panel_summary_card.dart`

New files:
* `knowledge_panel_image_card.dart`: Card that displays a Knowledge Panel _Image_ element.
* `knowledge_panel_text_card.dart`: Card that displays a Knowledge Panel _Text_ element.
* `website_card.dart`: Card that displays a website link. Code used to be inside `new_product_page.dart`

Impacted files:
* `knowledge_panel_card.dart`: minor refactoring
* `knowledge_panel_expanded_card.dart`: minor refactoring
* `knowledge_panel_page.dart`: minor refactoring
* `knowledge_panel_page_template.dart`: minor refactoring
* `knowledge_panels_builder.dart`: moved code here from `knowledge_panel_element_card.dart` and `knowledge_panel_summary_card.dart`; minor refactoring
* `new_product_page.dart`: moved the `WebsiteCard` code to a dedicated file; minor refactoring
* `product_cards_helper.dart`: minor refactoring
* `summary_card.dart`: minor refactoring

* feat: 4628 - additional TODO's
2023-10-28 07:32:03 +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
1c75f86d1d fixed crop and added padding (#4514) 2023-08-15 16:20:20 +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
a6cdcaf9c1 Rework how the carousel is managed (#4403) 2023-07-31 17:14:09 +02:00
fe7189c9db feat: Improve a11n by forcing a label on Nutri-Score / Eco-score / NOVA buttons (#4356)
* Improve a11n by forcing a label on Nutri-Score and Eco-score buttons

* Fix a typo

* Add more cases + NOVA

* Remove a print statement

* Improve a bit the score card

* Improve accessibility for KP title cards

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

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

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

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

---------

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2023-07-29 19:21:30 +02:00
829e2a1e3c feat: Improve the Nutrition Facts screen (#4278) 2023-07-21 01:42:53 +02:00
b03f60b085 feat: Better support RTL languages (#4310) 2023-07-16 20:29:51 +02:00
4f35708f74 feat: 3941 - refactoring about up-to-date product data for StatefulWidgets (#4262) 2023-07-13 09:15:09 +02:00
29bdad3f5b fix: Ensure we always use the SmoothAppBar and not the regular AppBar (#4184) 2023-06-18 17:22:22 +02:00
57cd4a8296 fix: 4121 - text selectable only if not clickable (#4138) 2023-06-14 10:37:20 +02:00
6c292c087d refactor: off-dart upgrade and new enum KnowledgePanelAction (#4075)
Impacted files:
* `knowledge_panel_action_card.dart`: now using the new `KnowledgePanelAction` enum
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded to `openfoodfacts: 2.5.2`
2023-06-05 10:23:31 +02:00
30be3388a4 feat: 4058 - expand/collapse for additional ecoscore fields (#4071)
* feat: 4058 - expand/collapse for additional ecoscore fields

New file:
* `product_field_editor.dart`: Helper class about product fields.

Impacted files:
* `add_new_product_page.dart`: added origins, ingredients, labels and packaging in option with expand/collapse; refactored using new classes around `ProductFieldEditor`
* `add_ocr_button.dart`: refactored using new class `ProductFieldOcrEditor`
* `add_packaging_button.dart`: refactored using new class `ProductFieldPackagingEditor
* `app_en.arb`: added one label for "additional ecoscore fields"
* `app_fr.arb`: added one label for "additional ecoscore fields"
* `edit_ocr_page.dart`: renamed from `edit_ingredients_page.dart`
* `edit_product_page.dart`: refactored using new classes `ProductFieldDetailsEditor`, `ProductFieldOcrIngredientEditor`, `ProductFieldPackagingEditor` and `ProductFieldOcrPackagingEditor`
* `knowledge_panel_action_card.dart`: minor refactoring
* `knowledge_panels_builder.dart`: minor refactoring
* `simple_input_page_helpers.dart`: added method `isPopulated`; minor refactoring
* `summary_card.dart`: refactored using new class `ProductFieldDetailsEditor`

* feat: 4058 - format

* feat: 4058 - refactoring

Impacted files:
* `add_simple_input_button.dart`: removed useless parameters; now uses `ProductFieldSimpleEditor`
* `edit_product_page.dart`: now uses `ProductFieldSimpleEditor`
* `product_field_editor.dart`: moved `edit` code from `simple_input_page_helpers.dart`
* `simple_input_page_helpers.dart`: moved code to `product_field_editor.dart`
2023-06-04 10:25:06 +02:00
72c55f64e6 feat: 3987 - now KP opens the new packaging page (#3989)
New file:
* `add_packaging_button.dart`: "Add (new) packaging" button for user contribution.

Impacted file:
* `knowledge_panel_action_card.dart`: now opens the new packaging page; refactoring
2023-05-20 18:51:30 +02:00
12a561a4a0 refact: score card refactoring (#3961)
Impacted files:
* `attributes_card_helper.dart`: refactor as advanced `enum` from `score_card_helper.dart`
* `knowledge_panel_summary_card.dart`: now using the new `ScoreCard.titleElement` constructor
* `score_card.dart`: refactored `CardEvaluation` as advanced `enum` from `score_card_helper.dart`; refactored `ScoreCard` with 2 explicit constructors instead of a single nameless one
* `score_card_helper.dart`: refactored `enum`s and moved code to more relevant files
* `summary_card.dart`: now using the new `ScoreCard.attribute` constructor
2023-05-13 10:30:21 +02:00
dc6f12f5d9 feat: Use a "well spaced" text style when there are many lines (#3825)
* Use a "well spaced" text when there are many lines of text

* Fix formatting
2023-04-17 18:07:50 +02:00
11f9c3d3cc fix: 3858 - display nothing if no KP widget children found (#3859)
Impacted files:
* `knowledge_panel_page_template.dart`: now using the KP children in order to be able to display nothing
* `knowledge_panels_builder.dart`: now we build a list of children, which gives us the opportunity to display nothing if empty
* `new_onboarding_page.dart`: now using the KP children in order to be able to display nothing
2023-04-08 15:04:55 +02:00
dd0d548413 chore: Revert "feat: 3585 - upgrade to flutter 3.7 (#3666)" (#3702)
* Revert "feat: 3585 - upgrade to flutter 3.7 (#3666)"

This reverts commit ad46236bdf77afea18b12cc69b3ee64a6752ee73.

* Update pubspec.yaml

* Update account_deletion_webview.dart
2023-02-14 09:38:09 +01:00
ad46236bdf feat: 3585 - upgrade to flutter 3.7 (#3666)
Impacted files:
* `account_deletion_webview.dart`: minor refactoring; could not test, unfortunately
* `background_task_badge.dart`: minor refactoring
* `camera_scan_page.dart`: minor refactoring
* `country_selector.dart`: minor refactoring
* `generated_plugin_registrant.cc`: wtf
* `generated_plugins.cmake`: wtf
* `GeneratedPluginRegistrant.swift`: wtf
* `Info.plist`: wtf
* `knowledge_panel_world_map_card.dart`: minor refactoring
* `network_config.dart`: minor refactoring
* `Podfile.lock`: wtf
* `product_query_page.dart`: minor refactoring
* `project.pbxproj`: wtf
* `pubspec.lock`: wtf
* `apple_app_store/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `google_play/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `app_store/shared/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `uri_store/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `data_importer/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `data_importer_shared/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `mlkit/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `scanner/shared/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `zxing/pubspec.yaml`: to dart 2.19 without restriction for flutter
* `smooth_app/pubspec.yaml`: to dart 2.19 without restriction for flutter; upgraded the versions
* `user_preferences_page_test.dart`: minor cheat - we need either to refactor with `launchUrl` or to fix `WebView`
2023-02-03 09:54:05 +01:00
ad7ac7732a refactor: Flutter v3.7.0 (#3642) 2023-01-31 22:39:07 +01:00
6321df0ce9 feat: 3418 - 7 new KP action handled (#3510)
Deleted files:
* `add_category_button.dart`
* `add_ingredients_button.dart`

New files:
* `add_ocr_button.dart`: "Add OCR image" button for user contribution.
* `add_simple_input_button.dart`: "Add simple input" button for user contribution.

Impacted files:
* `app_en.arb`: added 6 labels for 6 new buttons
* `knowledge_panel_action_card.dart`: added 7 new action cases for "Add" buttons; refactored in OOP
* `knowledge_panels_builder.dart`: now use generic `AddOcrButton`; refactored around `ProductState`
* `ocr_helper.dart`: added an abstract method for the "Add" button label
* `ocr_ingredients_helper.dart`: implemented the new "Add" button label method
* `ocr_packaging_helper.dart`: implemented the new "Add" button label method
* `simple_input_page_helpers.dart`: added an abstract method for the "Add" button label; implemented it in all offspring classes
* `summary_card.dart`: now use generic `AddSimpleInputButton`; refactored around `ProductState`
2023-01-03 20:46:07 +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