65 Commits

Author SHA1 Message Date
fe31fd9cdf feat: Ensure Country / Language / Nutrient picker look the same (#4389)
* Ensure Country / Language / Nutrient picker look the same

* Add a const constructor

* Some small improvements
2023-07-28 15:34:39 +02:00
1bae9408f1 Image placeholder now works again + a different animation (#4385) 2023-07-28 08:14:12 +02:00
ef15cab269 feat: Settings now use Modal Sheets 🤩 (#4307) 2023-07-22 17:31:15 +02:00
4c0d0a4ef6 feat: Add an always visible placeholder + error builder for Images (#4339) 2023-07-21 01:46:53 +02:00
a5fb0e1a4f feat: Input Source picker in a bottom sheet (#4281) 2023-07-12 16:41:12 +02:00
595fb7558d fix: 4140 : rounded rectangle for the language selector (#4154)
Impacted files:
* `country_selector.dart`: displays a `Row` instead of a `ListTile` (too big)
* `language_selector.dart`: displays a `Row` instead of a `ListTile` (too big)
* `product_image_viewer.dart`: added a rounded rectangle for the language selector
* `user_preferences_settings.dart`: added some paddings as the `Row` is smaller than a `ListTile`
2023-06-15 11:08:59 +02:00
ff1a20b074 Provide a Hero animation between the list of photos and the viewer (#4141) 2023-06-14 14:58:21 +02:00
c60f2a54c4 fix: 4032 - better paddings for login page (#4037)
* fix: 4032 - better paddings for login page

* fix: 4032 - golden generated png files

* fix: 4032 - hint text on max 2 lines
2023-05-28 18:08:59 +02:00
950c18b70b fix: On the product page, the Ripple on the back button doesn't work (#3998) 2023-05-26 11:34:36 +02:00
d58abae93c The Ripple effect of the language selector was invisible (#3994) 2023-05-21 08:34:32 +02:00
6e72ff0991 fix: 3595 - transient file refactoring and fixes (#3939)
New file:
* `background_task_upload.dart`: Background task about generic file upload.

Impacted files:
* `abstract_background_task.dart`: added a `recover` abstract method
* `background_task_crop.dart`: now extends new class `BackgroundTaskUpload`
* `background_task_image.dart`: now extends new class `BackgroundTaskUpload`
* `background_task_manager.dart`: now calls `recover`for each task at run time; minor fix about "internet error"
* `background_task_unselect.dart`: minor refactoring; minor fix removing the transient file
* `crop_page.dart`: minor refactoring
* `edit_ingredients_page.dart`: minor refactoring
* `image_upload_card.dart`: minor refactoring
* `product_cards_helper.dart`: minor refactoring
* `product_image_viewer.dart`: minor refactoring
* `smooth_product_image.dart`: minor refactoring
* `transient_file.dart`: refactored as a "real" class, not a static one
2023-05-13 10:12:52 +02:00
558034fb6f feat: 3897 - mutilingual gallery and swipeable images - read only (#3917)
New file:
* `image_field_extension.dart`: moved code from `product_cards_helper.dart`

Deleted files:
* `product_image_unswipeable_view.dart`
* `smooth_images_sliver_list.dart`
* `smooth_images_view.dart`

Impacted files:
* `image_upload_card.dart`: minor refactoring
* `language_selector.dart`: added an optional foreground color (use case: explicit white for images on a black background)
* `new_crop_page.dart`: minor refactoring
* `nutrition_page_loaded.dart: now using a new special case constructor of `ProductImageSwipeableView` instead of now deleted `ProductImageUnswipeableView`
* `product_cards_helper.dart`: added language-related methods; refactored
* `product_image_carousel.dart`: minor refactoring
* `product_image_data.dart`: added language
* `product_image_gallery_view.dart`: simplified the display of the 4 images; added the language selector on top; refactored the title
* `product_image_swipeable_view.dart`: now handles the "mono imagefield" case; now manages languages; minor refactoring
* `product_image_viewer.dart`: added the language selector; removed the irrelevant `Scaffold`
2023-04-29 13:56:36 +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
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
7abb9b9bd3 fix: visual inconsistency in app_settings (#3818) 2023-04-08 15:09:52 +02:00
0363affc81 feat: AMOLED Dark Mode (#3703)
* ignored some generated files

* init amoled mode

* color scheme

* test updated for amoled

* added accent color picker

* localized accent color picker

* added color provider

* Dark Mode changed to Theme mode

* Map key iteration only

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

Co-authored-by: Aman Raj <57723319+AshAman999@users.noreply.github.com>

* removed external dep

* updated golden test

* added comments

* using shade fun

* color scheme localization

* color scheme localization

* added textContrast

* color contrast app settings

* merged upstream

* typo fix

* added color to DropDownMenuItems

* SnackBar text, contrast level

* text contrast change to pass WCAG2.1

* snackBar Color Change

---------

Co-authored-by: Aman Raj <57723319+AshAman999@users.noreply.github.com>
2023-03-09 18:19:39 +01:00
ad7ac7732a refactor: Flutter v3.7.0 (#3642) 2023-01-31 22:39:07 +01:00
7121b0e78e feat: 2424 - new "select existing images" button (#3641)
* feat: 2424 - new "select existing image" button

New files:
* `background_task_crop.dart`: Background task about product image crop from existing file.
* `uploaded_image_gallery.dart`: Gallery of all images already uploaded, about a given product.

Delete file:
* `smooth_images_sliver_grid.dart`

Impacted files:
* `abstract_background_task.dart`: added reference to "crop" task
* `app_en.arb`: added 4 labels about "existing images" (button, page title, downloading, nothing found)
* `image_crop_page.dart`: refactored moving code here from `ProductImageViewer`
* `new_crop_page.dart`: now we can handle "already existing" images, in addition to the current choice for e.g. NUTRITION_FR
* `operation_type.dart`: added reference to new "crop" task
* `product_image_swipeable_view.dart`: unrelated fix - the title of the first reached page was always the title of the first page to the left
* `product_image_viewer.dart`: added a "select existing image" button; moved code to `image_crop_page.dart`
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded off-dart in order to user new methods

* feat: 2424 - upgraded to off-dart 2.2.0

Impacted files:
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded off-dart in order to user new methods
2023-01-27 06:36:08 +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
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
8831337a21 feat: 3332 - crop page title now reflects image field (#3366)
* feat: 3332 - crop page title now reflects image field

Impacted files:
* `confirm_and_upload_picture.dart`: minor refactoring
* `crop_helper.dart`: added a `pageTitle` parameter
* `edit_ingredients_page.dart`: minor refactoring
* `image_crop_page.dart`: added `imageField` parameters, so that we can compute the correct label on crop page
* `image_upload_card.dart`: now we explicitly use `getProductImageButtonText` as label
* `new_crop_page.dart`: added a page title parameter
* `product_cards_helper.dart`: new label method `getImagePageTitle`; minor refactoring
* `product_image_carousel.dart`: minor refactoring
* `product_image_data.dart`: removed label fields - now we have more flexibility, computing labels from `imageField` with `product_cards_helper.dart` methods
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_swipeable_view.dart`: now we explicitly use `getImagePageTitle` as label
* `product_image_viewer.dart`: minor refactoring
* `smooth_images_sliver_list.dart`: now we explicitly use `getProductImageTitle` as label
* `smooth_product_image.dart`: minor refactoring

* feat: 3332 - 2 lines for the title

Impacted files:
* `new_crop_page.dart`: 2 lines for the title

Co-authored-by: Aman Raj <57723319+AshAman999@users.noreply.github.com>
2022-11-28 20:39:22 +01:00
bc91d43327 feat: 3129 (New PR) Allow to swipe between product images on the full screen image (#3363)
* feat : 3129 (New PR) Allow to swipe between product images on the full screen image

* Resolved formatting issues

* Made the changes suggested in PR review

* Resolved formatting issues

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2022-11-27 10:10:22 +01:00
fba2851809 fix: 3018 - instant upload of images (#3329)
New files:
* `ocr_widget.dart`: Widget dedicated to OCR, with 3 actions: upload image, extract data, save. Used to be in `edit_ingredients_page.dart`
* `transient_file.dart`: Helper class about transient files (= not fully uploaded yet).

Impacted files:
* `add_basic_details_page.dart`: minor refactoring
* `add_new_product_page.dart`: refactored around the class image repository
* `app_en.arb`: added 1 label when OCR fails
* `app_fr.arb`: added 1 label when OCR fails
* `background_task_details.dart`: minor refactoring
* `background_task_image.dart`: immediate execution with just one try
* `confirm_and_upload_picture.dart`: minor refactoring with new private class `_OutlinedButton`
* `edit_ingredients_page.dart`: moved `OcrWidget` code to dedicated new dart file; fixed the extract button - that cannot be reached if the image is not uploaded yet
* `image_crop_page.dart`: refactored with more explicit method names
* `image_upload_card.dart`: refactored with `TransientFile`
* `new_product_page.dart`: minor refactoring
* `product_cards_helper.dart`: minor refactoring
* `product_image_carousel.dart`: minor refactoring
* `product_image_gallery_view.dart`: refactored with new method `confirmAndUploadNewPicture` and new class `TransientFile`
* `product_image_viewer.dart`: refactored with new class `TransientFile`
* `question_card.dart`: minor refactoring
* `smooth_product_image.dart`: refactored with new class `TransientFile`
2022-11-19 14:45:50 +01:00
b807c20b28 fix: Darkmode back button (#3264)
* fix: Darkmode

* Update lock

* 1
2022-11-04 19:22:32 +01:00
45aa97f671 chore: user authentication page testing (#3233)
* Tooltip to pass `labeledTapTargetGuideline`

* return empty view instead of null

* login page test

* signup page test

* golden updated.

* implemented changes

* forgot password page golden test

* forgot password page golden test

* typo fix

* Update packages/smooth_app/lib/pages/preferences/user_preferences_account.dart

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

Co-authored-by: Aman Raj <57723319+AshAman999@users.noreply.github.com>
Co-authored-by: Marvin Möltgen <39344769+M123-dev@users.noreply.github.com>
2022-11-02 17:01:14 +01:00
d43c02bb98 fix: backbutton now visible (#3170) 2022-10-22 21:08:08 +02:00
c0ab58af3d Fix brightness on iOS (#3132) 2022-10-13 20:58:00 +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
41bbf32c66 refactor: ProductImageData to contain all image links (#3088)
* refactor: ProductImageData to contain all image links

* Revert "refactor: ProductImageData to contain all image links"

This reverts commit 1a02022f562ef5069827007bb9025e10d8612639.

* refactor: ProductImageData imageUrl to ImageDescriptor

* refactor: Move _getProductImageData() to factory method

* refactor: Revert part of ImageDescriptor changes

* feat: ProductImageData getImageUrl

* fix: Gallery product image quality

* draft: Fallback is full image doesn't exist

* revert: Partial revert of fallback draft

* feat: Show error when image edit fails

* fix: Fallback to other image qualities

* fix: Remove other image sizes?
2022-10-12 19:19:09 +02:00
7d681a8601 fix: Consistent paddings between all Widgets in the product page (#3099) 2022-10-09 23:48:19 +02:00
f277e3e855 fix: harmonize search modals (#3085)
* make harmonized search models

* similar buttons in nutrition search page
2022-10-04 09:15:58 +02:00
6fb4fc9c79 sticky headers in search dialogs (#3040) 2022-09-19 20:20:38 +02:00
66d0b19145 SmoothListTileCard: onTap callback passed twice (#2949) 2022-09-06 17:31:20 +02:00
c70683939d feat: Add a gallery of the images selected and uploaded for a product (#2801)
* feat: image list gallery
* feat: display every image in gallery view
* feat: shimmering effect in `smooth_list_view.dart`
* docs: add documentation to `product_image_gallery_view.dart`
* refactor: extract SmoothBackButton

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2022-09-04 19:33:29 +02:00
418701472b fix: Placeholder image in case of image not loading (#2857)
* so placeholder image in case of image not loading

* delete unnessary SmoothProductImageContainer
2022-08-29 15:07:40 +02:00
6fb09e5ec2 use adaptive progress Indicator (#2831) 2022-08-23 11:18:59 +02:00
ddb8bea405 feat: Horizontal buttons for Dialogs (#2626)
* Revert "Revert "feat: Smooth Dialog with an axis for buttons (#2587)" (#2608)"

This reverts commit 6b52473394b921126d71be3291902ad27aa03e62.

* Many fixes

* Small doc + Title & Cross in separated widgets

* Increase a little bit the line height to improve readability

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2022-08-18 19:27:35 +02:00
d08b1bd377 feat: Sign up form: try to highlight the issue (#2535)
* Sign up form: try to highlight the issue

* oOOO
Dart format acts really weirdly on this one…

* Checkboxes: the whole item (including text) is clickable, not only the checkbox itself

* Sign up: Highlight the faulting field
2022-08-16 13:22:09 +02:00
bff9e92e04 feat: make text fields design use less space (#2725)
* feat: make text fields design use less space
* chore: simplify comparison

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2022-08-04 16:22:55 +02:00
0c5fab5c8d feat: #2503 - language selector now in "App Settings" (for all users) (#2658)
Impacted files:
* `language_selector.dart`: refactored for consistent data and filter
* `user_preferences_dev_mode.dart`: removed the language selector
* `user_preferences_settings.dart`: put the language selector, slightly refactored for UI consistency with country selector
2022-07-25 20:25:12 +02:00
d856b35035 feat: Language filter (#2539)
* feat: language filter

* feat: dev mode language search

* Oop, Open food facts Language used

* language picker seperated.

* localize choose app language

* fix: language filter changes requested

* fix: further optimization

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2022-07-22 13:58:16 +02:00
27681d101e feat: #2396 - preparatory step with simple refactoring (#2593)
New files:
* `smooth_product_card_template.dart`: Empty template for a product card display.
* `smooth_product_image_container.dart`: Container to display the main product image on a product card.

Impacted files:
* `smooth_product_card_found.dart`: fix as `backgroundColor` was not taken into account anymore
* `smooth_product_image.dart`: refactored with new class `SmoothImageContainer`
2022-07-14 13:07:32 +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
6ad23aefb2 fix: Ensure all text inputs have coherent cursors + heights (#2578)
* Ensure all textformfields have a coherent cursors + heights

* Fix: Don't request twice the DefaultTextStyle

* Remove unused attr
2022-07-12 11:09:40 +02:00
1c1821d525 lint: Remove useless files (#2406) 2022-06-27 20:39:42 +02:00
ee82d91019 feat: Migration to Flutter 3.0 / Dart 2.17 (#2307)
* Migration to Flutter 3 / Dart 2.17 (enums migrated)

* Dart 2.17 (Super initializers)

* Remove all new super.key

* indice -> idx
2022-06-20 16:45:27 +02:00
37defe7ce5 added error svg's (#2263) 2022-06-13 16:34:33 +02:00
4e6d51fb67 feat: #2067 - code cleaning (#2185)
Impacted file:
* `personalized_ranking_page.dart`: code cleaning
2022-06-06 15:19:57 +02:00
6fb61c17e4 feat: Update to new color scheme (#2028)
* feat: Update to new color scheme

* Update goldens

* Update packages/smooth_app/lib/themes/smooth_theme.dart

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

* Updated to new smaller color scheme

* Updated Goldens

* Some minor fixes

* Update pubspec.lock

* Update goldens

* Next fixes

* fix login page

* More fixes

* Even more fixes

* latest fixes with pierre

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2022-06-02 19:02:08 +02:00
98c6fa1fe7 feat: New visor UI (#2122)
* New visor UI

* Remove an unused variable
2022-06-02 08:11:27 +02:00