35 Commits

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

* New GA

* Fix dartdoc
2025-06-23 18:14:17 +02:00
dda75e283e feat: Flutter 3.32 (#6665)
* Migration to Flutter 3.32

* Temporary ignore dart formatter issues
2025-06-23 09:56:00 +02: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
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
9e3cea3ac3 Hide Robotoff banner on the onboarding (#5369) 2024-06-14 19:26:56 +02:00
1728eff579 Replace all MediaQuery.of(context).size with MediaQuery.sizeOf(context) (#5328) 2024-06-03 17:09:37 +02:00
05d0490080 feat: 4513 - user preferences pages simple refactoring (#4620)
New files:
* `user_preferences_advanced_settings.dart`: used to be `_AdvancedSettings` in `user_preferences_settings.dart`
* `user_preferences_camera_sound.dart`: used to be `_CameraPlayScanSoundSetting` in `user_preferences_settings.dart`
* `user_preferences_choose_accent_color.dart`: used to be `_ChooseAccentColor` in `user_preferences_settings.dart`
* `user_preferences_choose_app_theme.dart`: used to be more or less `_ChooseAppTheme` in `user_preferences_settings.dart`
* `user_preferences_choose_text_color_contrast.dart`: used to be `_ChooseTextColorContrast` in `user_preferences_settings.dart`
* `user_preferences_country_selector.dart`: used to be coded in `user_preferences_settings.dart`
* `user_preferences_crash_reporting.dart`: used to be `_CrashReportingSetting` in `user_preferences_settings.dart`
* `user_preferences_haptic_feedback.dart`: used to be `_HapticFeedbackSetting` in `user_preferences_settings.dart`
* `user_preferences_image_source.dart`: used to be coded in `user_preferences_settings.dart`
* `user_preferences_language_selector.dart`: used to be coded in `user_preferences_settings.dart`
* `user_preferences_rate_us.dart`: used to be `_RateUs` in `user_preferences_settings.dart`
* `user_preferences_send_anonymous.dart`: used to be `_SendAnonymousDataSetting` in `user_preferences_settings.dart`
* `user_preferences_share_with_friends.dart`: used to be `_ShareWithFriends` in `user_preferences_settings.dart`

Impacted files:
* `abstract_user_preferences.dart`: minor refactoring
* `preferences_page.dart`: minor refactoring
* `user_preferences.dart`: minor refactoring
* `user_preferences_account.dart`: removed `UserPreferencesSection` and `_UserPreferencesAccountSubTitleSignOut` for simplification
* `user_preferences_attribute_group.dart`: refactored as not `AbstractUserPreferences`
* `user_preferences_connect.dart`: minor refactoring
* `user_preferences_contribute.dart`: minor refactoring
* `user_preferences_dev_mode.dart`: minor refactoring
* `user_preferences_faq.dart`: minor refactoring
* `user_preferences_food.dart`: minor refactoring
* `user_preferences_page.dart`: minor refactoring
* `user_preferences_settings.dart`: file was too big - moved code to new files+classes
2023-09-12 19:25:29 +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
8d0ae6a72d Onboarding: scrollbars everywhere + expanded card (#4342) 2023-07-29 19:26:55 +02: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
6d053667a0 fix: Prevent edit of perfect product on onboarding (#3489)
* check whether or not to allow edit

* remove extra spacing
2022-12-31 11:55:39 +01:00
cc1cc4a8e1 Onboarding: ensure the bottom padding is consistent across screens on iOS (#3192) 2022-10-22 22:47:55 +02:00
e3564e53a4 refactor: Make smooth_app a module (also called step 1) (#3101)
* Make smooth_app a module (also called step 1)

Android impl is OK.
Still have to check for iOS and tests

* Fix scan sound not working

* Fix ci/pub_upgrade.sh issues

* Fix tests

* Some doc

* Fix build actions

* Fix iOS build

* Fix warnings

* Fix Flutter analyze

* Fix typo

* The CI needs at least one test

Co-authored-by: Marvin Möltgen <39344769+M123-dev@users.noreply.github.com>
2022-10-13 18:33:14 +02:00
6fb09e5ec2 use adaptive progress Indicator (#2831) 2022-08-23 11:18:59 +02:00
e798376f1c fix: screenshot - different Key for different screens (#2798)
Impacted files:
* `app_test.dart`: added the "reinvention" page; set different "next" keys; handled tooltip on KP pages
* `knowledge_panel_page_template.dart`: specific "next" keys; added "tooltip" key
* `next_button.dart`: new `nextKey` parameter
* `onboarding_bottom_bar.dart`: added `nextKey` parameter used during screenshot generation
* `preferences_page.dart`: specific "next" key
* `reinvention_page.dart`: specific "next" key
* `sample_eco_card_page.dart`: specific "next" key
* `sample_health_card_page.dart`: specific "next" key
* `scan_example.dart`: specific "next" key
* `welcome_page.dart`: specific "next" key
2022-08-18 09:29:45 +02:00
9ebe5c849c feat: Remove a maximum of hardcoded sizes and move Padding to Directional ones (#2534)
* Remove a maximum of hardcoded sizes and move Padding to Directional ones

* Fix build issue

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2022-07-13 14:58:02 +02:00
6112142de3 fix: #2305 - cleaner layout for onboarding (preferences + kp) (#2306)
Impacted files:
* `knowledge_panel_page_template.dart`: cleaner layout with spaceBetween and flexible
* `preferences_page.dart`: cleaner layout with spaceBetween and flexible
2022-06-19 11:31:21 +02:00
70cfea0b92 fix: #2123 onboarding preference issues (#2231) 2022-06-09 22:01:23 +02:00
b214d23545 feat: #2001 - matched the figma mocks for the 6 onboarding pages (#2017)
* feat: #1918 #1934 - simplified user preferences food

Deleted file:
* `abstract_collapsible_user_preferences.dart`: not really relevant anymore and source of confusion - the code was refactored to its only child, `UserPreferencesAttributeGroup`

Impacted files:
* `abstract_user_preferences.dart`: refactored without the "collapsed" option
* `Podfile.lock`: wtf
* `preferences_page.dart`: simplified the display (that was Scaffold^2)
* `project.pbxproj`: wtf
* `pubspec.lock`: wtf
* `user_preferences.dart`: added a setter/getter about the unique active attribute group
* `user_preferences_attribute_group.dart`: refactored around the unique active attribute group - no action and no icon for the only expanded group
* `user_preferences_food.dart`: removed doubled description and refresh button from onboarding
* `user_preferences_profile.dart`: unrelated minor refactoring

* feat/#1918 - changed collapsed/expanded arrows for attribute groups

Deleted file:
* `smooth_animated_collapse_arrow.dart`

Impacted file:
* `user_preferences_attribute_group.dart`: changed collapsed/expanded arrows

* Update packages/smooth_app/ios/Podfile.lock

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

* feat: #2001 - matched the figma mocks for the first 5 onboarding pages

Deleted file:
* `scan_example.svg`

New files:
* `eco.svg`
* `globe.svg`
* `health.svg`
* `preferences.svg`
* `scan.svg`
* `title.svg`

Impacted files:
* `knowledge_panel_page_template.dart`: matched the figma mock; new parameters - svg asset and background color
* `next_button.dart`: matched the figma mock
* `onboarding_flow_navigator.dart`: added background color
* `preferences_page.dart`: matched the figma mock
* `sample_eco_card_page.dart`: new parameters - svg asset and background color
* `sample_health_card_page.dart`: new parameters - svg asset and background color
* `scan_example.dart`: matched the figma mock
* `welcome_page.dart`: matched the figma mock

* feat: #2001 - matched the figma mocks for the 6th onboarding page

New file:
* `analytics.svg`

Impacted files:
* `consent_analytics_page.dart`: matched the figma mock
* `onboarding_flow_navigator.dart`: minor refactoring

* github mess

* github mess

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

Co-authored-by: Marvin M <39344769+M123-dev@users.noreply.github.com>

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

Co-authored-by: Marvin M <39344769+M123-dev@users.noreply.github.com>

* github mess

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
Co-authored-by: Marvin M <39344769+M123-dev@users.noreply.github.com>
2022-05-27 11:37:17 +02:00
e55c5ee912 feat: #1918 #1934 - simplified user preferences food (#1950)
* feat: #1918 #1934 - simplified user preferences food

Deleted file:
* `abstract_collapsible_user_preferences.dart`: not really relevant anymore and source of confusion - the code was refactored to its only child, `UserPreferencesAttributeGroup`

Impacted files:
* `abstract_user_preferences.dart`: refactored without the "collapsed" option
* `Podfile.lock`: wtf
* `preferences_page.dart`: simplified the display (that was Scaffold^2)
* `project.pbxproj`: wtf
* `pubspec.lock`: wtf
* `user_preferences.dart`: added a setter/getter about the unique active attribute group
* `user_preferences_attribute_group.dart`: refactored around the unique active attribute group - no action and no icon for the only expanded group
* `user_preferences_food.dart`: removed doubled description and refresh button from onboarding
* `user_preferences_profile.dart`: unrelated minor refactoring

* feat/#1918 - changed collapsed/expanded arrows for attribute groups

Deleted file:
* `smooth_animated_collapse_arrow.dart`

Impacted file:
* `user_preferences_attribute_group.dart`: changed collapsed/expanded arrows

* Update packages/smooth_app/ios/Podfile.lock

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

* Whatever works for that bloody github...

* Whatever works for that bloody github...

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2022-05-27 11:08:42 +02:00
f44c19caa5 Fix onboarding food preferences overflow (#1853) 2022-05-19 19:06:21 +02:00
c3b44aced2 fix: Flutter 3.0 fixes (#1814)
* fix: Flutter 3.0 fixes

* Workflows

* Update gradle

* Automated fixes

* Manual async gap fixes

* Fix merge conflict reverts

* Format

* qr_code_scanner fixes
2022-05-12 16:07:22 +02:00
c43ad920ed feat: #1501 - refactored user preferences files into a dedicated folders (#1812) 2022-05-11 08:22:34 +02:00
342c5f18dc feat: #1501 - split of the preference page into detailed pages (#1797)
Deleted files:
* `faq_handle_view.dart`
* `list_helper.dart`
* `smooth_list_tile.dart`
* `social_handle_view.dart`
* `user_contribution_view.dart`

New files:
* `abstract_collapsible_user_preferences.dart`: Abstraction of a collapsed/expanded display for the preference pages.
* `all_user_product_list_page.dart`: Page that lists all user product lists.
* `user_preferences_connect.dart`: Display of "Connect" for the preferences page.
* `user_preferences_contribute.dart`: Display of "Contribute" for the preferences page.
* `user_preferences_faq.dart`: Display of "FAQ" for the preferences page.
* `user_preferences_list_tile.dart`: Custom `ListTile` for preferences.

Impacted files:
* `abstract_user_preferences.dart`: refactoring around the fact that now we display pages instead of collapsible List<Widget>
* `continuous_scan_model.dart`: refactored around `DaoProductList` being seldom `async`
* `dao_product_list.dart`: new method `getLength`; refactored with less `async` methods
* `new_product_page.dart`: refactored around `DaoProductList` being seldom `async`
* `preferences_page.dart`: minor refactoring
* `product_list_import_export.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_page.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_supplier.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_user_dialog_helper.dart`: new "delete list?" dialog; refactored around `DaoProductList` being seldom `async`
* `query_product_list_supplier.dart`: refactored around `DaoProductList` being seldom `async`
* `user_preferences_attribute_group.dart`: minor refactoring
* `user_preferences_dev_mode.dart`: minor refactoring
* `user_preferences_food.dart`: minor refactoring
* `user_preferences_page.dart`: now we use the same `StatefulWidget` for a root page with only headers and detailed pages with bodies; added item "Lists"; created 3 new "top paragraphs" extracted from "settings".
* `user_preferences_page-blue-dark.dart`: impacted by new page design
* `user_preferences_page-blue-light.dart`: impacted by new page design
* `user_preferences_page-brown-dark.dart`: impacted by new page design
* `user_preferences_page-brown-light.dart`: impacted by new page design
* `user_preferences_page-green-dark.dart`: impacted by new page design
* `user_preferences_page-green-light.dart`: impacted by new page design
* `user_preferences_profile.dart`: minor refactoring
* `user_preferences_settings.dart`: minor refactoring
2022-05-10 20:53:34 +02:00
e8e7fb4fa2 fix: Add missing translations (#1572)
* Add missing translations

* Email content translation

* 2 hardcoded strings

* Fix categories tests not working anymore

* Add missing translation

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

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

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

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

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2022-05-08 13:01:31 +02:00
e11a24a474 fix: #1720 - now we cannot remove a product from onboarding (#1721)
There was a Carousel/Provider side-effect.

Impacted files:
* `preferences_page.dart`: used new parameter `isRemovable`
* `product_title_card.dart`: new parameter `isRemovable`
* `summary_card.dart`: new parameter `isRemovable`
2022-04-30 14:32:55 +02:00
6ae6d5c833 refactor: removing a tmp code file (#1512)
Now that knowledge panels are an explicit field of product, we can simplify the code.

Deleted files:
* `onboarding_data_knowledge_panels.dart`
* `tmp.dart`

Impacted files:
* `knowledge_panels_template.dart`: now using the new `OnboardingDataProduct.forKnowledgePanels` constructor
* `onboarding_data_product.dart`: refactored in order to include knowledge panels as part of product
* `onboarding_loader.dart`: now using the new `OnboardingDataProduct` constructors
* `preferences_page.dart`: now using the new `OnboardingDataProduct.forProduct` constructor
2022-04-07 18:03:12 +02:00
8646d58a74 feat: remove hardcoded colors in on boarding slides (#1391) 2022-03-29 22:41:59 +02:00
b2f6eea01a Preferences page (#1290)
Preferences page: no need for Positioned Widget

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marvin M <39344769+M123-dev@users.noreply.github.com>
2022-03-22 10:14:36 +01:00
22ede7171f CircularProgress Indicator (#1253)
* chore(develop): release 0.2.0

* added dark theme on personalized page

* Certain Changes

* Reverted changelog changes

* wrapped the circular progress indicator with center widget

* wrapped CircularProgressIndicator with Center Widget

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marvin M <39344769+M123-dev@users.noreply.github.com>
2022-03-19 10:35:35 +01:00
0d61134375 General radius throughout the app (#1179)
* Added design const

* ROUNDED_RADIUS

* General radius throughout the app

* Update smooth_main_button.dart

* .all instead of .circular
2022-03-03 21:25:46 +01:00
e874bbeea0 refactor: Package merge (#981) 2022-01-26 16:50:13 +01:00
954449e437 feat: #935 - now we display localized (downloaded) data during onboarding (#986)
Deleted files:
* `sample_eco_knowledge_panels.json`: replaced by new file `sample_knowledge_panels.json`
* `sample_health_knowledge_panels.json`: replaced by new file `sample_knowledge_panels.json`

New files:
* `abstract_onboarding_data.dart`: Abstraction of data we download, store and reuse at onboarding.
* `dao_string.dart`: Where we store strings.
* `loading_dialog.dart`: Dialog with a stop button, while a future is running.
* `onboarding_data_knowledge_panels.dart`: Helper around knowledge panels we download, store and reuse at onboarding.
* `onboarding_data_product.dart`: Helper around a product we download, store and reuse at onboarding.
* `onboarding_loader.dart`: Helper around data we download, store and reuse at onboarding.
* `sample_knowledge_panels.json`: json data downloaded today for en_US, cf. onboarding_data_knowledge_panels.dart
* `tmp.dart`: Fixes to off-dart.

Impacted files:
* `knowledge_panel_page_template.dart`: added parameters to 1. use the database (and downloaded data) and 2. limit the display to a given panel
* `knowlegde_panel_builder.dart`: added a method to display only one panel
* `local_database.dart`: added new dao `DaoString`
* `new_product_page.dart`: refactored
* `next_button.dart`: added an optional call to async methods at "next" time - e.g. data download
* `nutrition_page_loaded.dart`: now uses the new `LoadingDialog`
* `onboarding_flow_navigator.dart`: now using the database to get more relevant (previoulsy downloaded) data
* `preferences_page.dart`: now using previously downloaded data instead of assets
* `product_dialog_helper.dart`: now uses the new `LoadingDialog`
* `question_card.dart`: unrelated minor refactoring
* `sample_eco_card_page.dart`: now using previously downloaded data instead of assets, and displaying only the environment card
* `sample_health_card_page.dart`: now using previously downloaded data instead of assets, and displaying only the health card
* `sample_product_json.dart`: json data downloaded today for en_US, cf. onboarding_data_product.dart
* `sign_up_page.dart`: now uses the new `LoadingDialog`
2022-01-20 20:28:07 +01:00
cb320e600f fix: #899 - avoid to reload the product in onboarding (#902)
Impacted file:
* `preferences_page.dart`: split in two the process - load product and then display it with preferences
* `smooth_app/pubspec.yaml`: upgrade to openfoodfacts 1.9.1
* `smooth_app/pubspec.lock`: impacted by pubspec.yaml
* `smooth_ui_library/pubspec.yaml`: upgrade to openfoodfacts 1.9.1
* `smooth_ui_library/pubspec.lock`: impacted by pubspec.yaml
* `smooth_ui_library/example/pubspec.lock`: impacted by pubspec.yaml
2022-01-09 14:22:19 +01:00
80c216e992 Onboarding flow - Preference page (#866) 2022-01-06 17:52:17 +01:00