41 Commits

Author SHA1 Message Date
e74f94abc3 fix: Visual glitches (#6724)
* SmoothScaffold everywhere

* DateFormat from MaterialLocalizations

* Packagings: fix InkWell
2025-07-08 17:27:21 +02:00
692610cf6f Bump to flutter_lints 6.0.0 (#6713) 2025-07-06 12:01:44 +02:00
e3bc40fdf3 chore: Migration to Dart 3.8 (#6668)
* Migration to Dart 3.8

* New GA

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

* Temporary ignore dart formatter issues
2025-06-23 09:56:00 +02:00
f3af118820 fix: adjust padding logic in product image gallery layout (#6516) 2025-04-04 10:03:09 +02:00
67539c17f3 Suggestions for countries (#6344) 2025-02-05 16:05:29 +01:00
cdf637d960 fix: Product edition UI improvements (#6320)
* Edition improvements

* Sketch file

* Nutrition editor: the Next key is working again on Android

* Nutrition editor: tapping the title will force the focus on the TextField
2025-02-03 17:26:56 +01:00
aab292a1f4 feat: Use the photo banner for all photos + OCR pages (#6298)
* Use the photo banner directly for all photos + OCR (ingredients/packaging)

* Remove the long press for "More interesting photos"

* Tooltip for the 3 dots
2025-01-28 09:08:44 +01:00
0e45c574d4 fix: Hide more interesting photo if nothing is available (#6251)
* Hide more interesting photo if nothing is available

* The translation is actually used elsewhere
2025-01-20 19:20:50 +01:00
0020264c40 feat: Add infos about the photo in the modal sheet (gallery) (#6229)
* Info about the photo in the banner

* Contributor's name + expandable container

* Recenter outdated icon
2025-01-19 13:03:55 +01:00
5ddb5127ec New UI for ingredients (#6156) 2025-01-08 13:38:50 +01:00
85c13502d2 Migration to Flutter 3.27 (#6076)
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2024-12-29 15:20:05 +01:00
8bf8299716 fix: Improvements for devices with text scale multipliers (#5995) 2024-12-04 21:31:26 +01:00
12b3c48a4d "Use photo as" according to the type (#5972) 2024-11-30 13:44:27 +01:00
b54e461256 feat: "Use photo as" available directly in the gallery (+ a fix) (#5916)
* Fix FAB showing/hiding with the TabBar

* "Use photo as" available in the gallery
2024-11-24 14:12:01 +01:00
b44a5f546c feat: Many improvements for the photo gallery (#5895)
* Improvements for the photo gallery (and many many other changes)

* Make the indicator white (temporary?)

---------

Co-authored-by: Edouard Marquez <edouard@marquez.cool>
2024-11-23 12:45:50 +01:00
9eba6ae3be feat: UI Improvements for the photo gallery (#5852)
* Improve the photo gallery UI

* ClipRrect needed

* Improve the photo gallery UI

* ClipRrect needed

---------

Co-authored-by: Edouard Marquez <edouard@marquez.cool>
2024-11-14 11:16:23 +01: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
a51e06db42 Ensure the image is fully visible (#5614) 2024-09-25 11:38:18 +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
7cfe033aad Add the name of the contributor (#5565) 2024-08-31 11:24:34 +02:00
344518d048 feat: Photo gallery for "Others" (#5501)
* Photo gallery for "Others"

* Error + loading

* Photo details

* Fix weird animation
2024-08-02 17:36:02 +02:00
a797ebde6d feat: Add the outdated indicator to the photo grid (#5491)
* Add the outdated indicator to the photo grid

* Add some comments
2024-07-22 12:13:01 +02:00
1118349b00 Remove all unnecessary MediaQuery.of() (#5459) 2024-07-20 09:46:53 +02:00
1c4b95954e fix: Fix performances on the photos gallery (#5447)
* Improve performances for the photos gallery

* Allow to pass an `ImageSize` to `ProductImageWidget`

* Update packages/smooth_app/lib/pages/image/product_image_gallery_other_view.dart

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

---------

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2024-06-28 09:07:12 +02:00
64d38f17da feat: Improve photo gallery accessibility + internationalization (#5366)
* Photo gallery: accessibility improvements + date format translatable

* Fix typos

* Use `DateFormat.ymd` instead

* Card based layout
2024-06-18 13:42:39 +02:00
c26528c9b9 feat: 5323 - generic way to display product images, with timestamp (#5333)
New file:
* `product_image_widget.dart`: Displays a product image thumbnail with the upload timestamp on top.

Impacted files:
* `product_image_gallery_other_view.dart`: now using new widget `ProductImageWidget`
* `uploaded_image_gallery.dart`: now using new widget `ProductImageWidget`
2024-06-02 20:25:33 +02:00
529fe8f5e1 feat: 5301 - price proofs can be cropped and will be displayed (#5305)
* feat: 5301 - price proofs can be cropped and will be displayed

New files:
* `crop_helper.dart`: Crop Helper for images in crop page: process to run when cropping an image.
* `crop_parameters.dart`: Parameters of the crop operation.
* `product_crop_helper.dart`: Crop Helpers for product images.
* `proof_crop_helper.dart`: Crop Helper for proof images.

Impacted files
* `add_new_product_page.dart`: minor refactoring
* `background_task.dart`: new method `isDeduplicable`
* `background_task_add_price.dart`:
* `background_task_image.dart`: made some methods `static` and public to be reused
* `background_task_manager.dart`: now using new method `isDeduplicable`
* `background_task_upload.dart`: new method `isDeduplicable`
* `crop_page.dart`: refactored using `CropHelper`
* `image_crop_page.dart`: minor refactoring
* `may_exit_page_helper.dart`: minor refactoring
* `price_model.dart`: minor refactoring
* `price_proof_card.dart`: now we may crop the image and we also display the result
* `product_image_crop_button.dart`: refactored using `CropHelper`
* `uploaded_image_gallery.dart`: minor refactoring

* feat: 5301 - fixed WillPopScope2

Impacted files
* `crop_page.dart`: fixed `WillPopScope2`
* `product_price_add_page.dart`: added a `TODO`
* `price_proof_card.dart`: minor refactoring

* Unrelated - fixed `getUrl` bug (was always PROD, never TEST)

New file:
* `signalconso.png`: new asset

Impacted files
* `product_cards_helper.dart`: fixed `getUrl` bug (was always PROD, never TEST)
* `product_image_crop_button.dart`: fixed `getUrl` bug (was always PROD, never TEST)
* `product_image_gallery_other_view.dart`: fixed `getUrl` bug (was always PROD, never TEST)
* `product_image_other_page.dart`: fixed `getUrl` bug (was always PROD, never TEST)
* `uploaded_image_gallery.dart`: fixed `getUrl` bug (was always PROD, never TEST)
2024-05-30 14:34:35 +02:00
1922d39f07 feat: 5128 - visible dates on raw image grid items (#5144)
Impacted files:
* `product_image_gallery_other_view.dart`: display the upload date on top of raw image grid items
* `product_image_gallery_view.dart`: unrelated minor refactoring
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgrade to off-dart 3.5.0 in order to get the uploaded timestamp of raw images
* `smooth_image.dart`: unrelated minor refactoring
2024-04-08 13:01:13 +02:00
89cea10a42 feat: 4674 - immediate access to "other" pictures if possible (#4928)
New file:
* `background_task_product_change.dart`: Interface for background tasks that change a product.

Impacted files:
* `background_task_crop.dart`: minor refactoring
* `background_task_details.dart`: minor refactoring, implementing new interface `BackgroundTaskProductChange`
* `background_task_image.dart`: minor refactoring
* `background_task_unselected.dart`: minor refactoring, implementing new interface `BackgroundTaskProductChange`
* `background_task_upload.dart`: minor refactoring, implementing new interface `BackgroundTaskProductChange`
* `product_cards_helper.dart`: new method `getRawProductImages`
* `product_image_gallery_other_view.dart`: now we may have directly the raw images, and if needed we refresh the product instead of fetching specific image ids
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_other_page.dart`: replaced deprecated method
* `product_image_server_button.dart`: now we may have directly the raw images, and if needed we refresh the product instead of fetching specific image ids
* `product_image_viewer.dart`: replaced deprecated method
* `pubspec.lock`: generated
* `pubspec.yaml`: upgraded to off-dart 3.3.0
* `uploaded_image_gallery.dart`: now using `List<ProductImage>` as input
2024-01-25 21:12:34 +01:00
c76715dad4 fix: 4925 - consistency for "edit product" app bars (#4931)
Impacted files:
* `add_basic_details_page.dart`: now using new method `buildEditProductAppBar`
* `add_other_details_page.dart`: now using new method `buildEditProductAppBar`; removed an irrelevant barcode display
* `edit_new_packagings.dart`: now using new method `buildEditProductAppBar`
* `edit_ocr_page.dart`: now using new method `buildEditProductAppBar`
* `edit_product_page.dart`: removed inconsistent `fullScreenDialog:true` parameters
* `nutrition_page_loaded.dart`: now using new method `buildEditProductAppBar`; removed inconsistent `fullScreenDialog:true` parameters
* `product_cards_helper.dart`: new method `buildEditProductAppBar` instead of `buildProductTitle`
* `product_field_editor.dart`: removed inconsistent `fullScreenDialog:true` parameters
* `product_image_gallery_view.dart`: now using new method `buildEditProductAppBar`
* `product_image_other_page.dart`: now using new method `buildEditProductAppBar`
* `simple_input_page.dart`: now using new method `buildEditProductAppBar`
* `simple_input_widget.dart`: now we don't display the widget title on a single widget page - in order to avoid title redundancy
2024-01-07 17:54:10 +01:00
f81ba98ec1 feat: Use the Slivers mechanism with the Gallery view (#4913)
* Use the Slivers mechanism with the Gallery view

* Remove the print from the demo

* Also remove keep alives

* Ok, here is your format thing

* Remove Provider
2023-12-16 12:06:17 +01:00
f0c26da284 feat: 4674 - added the "other photos" section (#4866)
* feat: 4674 - added the "other photos" section

New files:
* `product_image_gallery_other_view.dart`: Display of the other pictures of a product.
* `product_image_other_page.dart`: Full page display of a raw product image.

Impacted file:
* `product_image_gallery_view.dart`: added the "other photos" section; fixed a "refresh not working" bug

* feat: 4674 - added a "click button" step

* feat: 4674 - different label for button

Impacted files:
* `app_en.arb`: add new label for "click for other photo" button
* `app_fr.arb`: add new label for "click for other photo" button
* `product_image_gallery_view.dart`: used new label for "click for other photo" button
2023-12-08 17:51:18 +01:00
b91a784599 Ensure there is a visible button in the Existing photos screen (#4872) 2023-12-06 15:26:14 +01:00
75683db4af feat: 3919 - select languages for new product images (#4255)
* feat: 3919 - select languages for new product images

New file:
* `add_new_product_helper.dart`: Helper classes for `AddNewProductPage` that was getting too big.

Impacted files:
* `add_basic_details_page.dart`: minor refactoring
* `add_new_product_page.dart`: moved code to new file `add_new_product_helper.dart`; refactored the trackers with new class `AnalyticsProductTracker`; refactored the access to image edit
* `add_simple_input_button.dart`: minor refactoring
* `crop_page.dart`: minor refactoring
* `edit_new_packagings.dart`: minor refactoring
* `edit_ocr_page.dart`: minor refactoring
* `edit_product_page.dart`: minor refactoring
* `image_crop_page.dart`: minor refactoring
* `image_field_extension.dart`: minor refactoring
* `nutrition_page_loaded.dart`: minor refactoring
* `product_cards_helper.dart`: minor refactoring
* `product_field_editor.dart`: minor refactoring
* `product_image_carousel.dart`: minor refactoring
* `product_image_carousel_item.dart`: renamed from `image_upload_card.dart`
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_local_button.dart`: minor refactoring
* `product_image_server_button.dart`: minor refactoring
* `product_image_swipeable_view.dart`: minor refactoring
* `product_image_viewer.dart`: minor refactoring
* `product_refresher.dart`: minor refactoring
* `uploaded_image_gallery.dart`: minor refactoring

* feat: 3919 - merge conflict fixes

* feat: 3919 - conflict fix

---------

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2023-08-24 09:20:36 +02:00
29bdad3f5b fix: Ensure we always use the SmoothAppBar and not the regular AppBar (#4184) 2023-06-18 17:22:22 +02:00
72f33964ab fix: 3899 - back to the main photo page after cropping from gallery (#3938)
Impacted files:
* `app_cs.arb`: unrelated warning fix
* `app_pl.arb`: unrelated warning fix
* `app_pt.arb`: unrelated warning fix
* `app_ro.arb`: unrelated warning fix
* `crop_page.dart`: unrelated fix - the new `CropImage` we use does already dispose the controller
* `uploaded_image_gallery.dart`: when a file was returned from the crop page, we go back to the previous page
2023-05-13 10:10:49 +02:00
2115b8b652 feat: 3765 - now using the "crop_image" package (#3926)
* feat: 3765 - now using the "crop_image" package

Deleted files:
* `crop_grid.dart`
* `rotated_crop_controller.dart`
* `rotated_crop_image.dart`
* `rotation.dart`

Impacted files:
* `background_task_image.dart`: minor refactoring
* `crop_page.dart`: renamed and moved; now using the `crop_image` package
* `image_compute_container.dart`: renamed and moved; refactored
* `image_crop_page.dart`: minor refactoring
* `product_image_viewer.dart`: minor refactoring
* `pubspec.lock`: wtf
* `pubspec.yaml`: added `crop_image`, upgraded `image` and related packages
* `uploaded_image_gallery.dart`: minor refactoring

* feat: 3765 - now using the CropController.getCroppedBitmap method

Impacted files:
* `background_task_image.dart`: minor refactoring
* `image_compute_container.dart`: removed code that is now in `CropController`
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded `crop_image`
2023-05-02 07:29:04 +02:00
a8366fd49f feat: 3897 - no language selector for gallery, only for swipeable page (#3924)
* feat: 3897 - no language selector for gallery, only for swipeable page

Main changes:
* `app_en.arb`: added 2 translations ("no image" / "no image for that language")
* `app_fr.arb`: added 2 translations ("no image" / "no image for that language")
* `nutrition_page_loaded.dart`: removed an implicit `language` parameter
* `product_cards_helper.dart`: refactoring
* `product_image_gallery_view.dart`: removed the language selector
* `product_image_swipeable_view.dart`: removed the language parameter; now we always start with the app language
* `product_image_viewer.dart`: now always displays the (non) image for the specified language, with additional labels; added explicit `language` parameters
* `transient_file.dart`: new method `getImageLanguages`

Added explicit `language` parameters for:
* `add_new_product_page.dart`: added an explicit `language` parameter
* `background_task_crop.dart`: added an explicit `language` parameter
* `background_task_image.dart`: added an explicit `language` parameter
* `background_task_unselect.dart`: added an explicit `language` parameter
* `edit_ingredients_page.dart`: added an explicit `language` parameter
* `edit_new_packagings.dart`: added an explicit `language` parameter
* `image_crop_page.dart`: added an explicit `language` parameter
* `image_upload_card.dart`: added an explicit `language` parameter
* `new_crop_page.dart`: added an explicit `language` parameter
* `product_image_local_button.dart`: added an explicit `language` parameter
* `product_image_server_button.dart`: added an explicit `language` parameter
* `uploaded_image_gallery.dart`: added an explicit `language` parameter

* feat: 3897 - slightly related refactoring around ImageFieldSmoothieExtension

* feat: 3897 - minor fix for TEST env
2023-04-30 18:34:35 +02:00
c9935da9b6 feat: 3656 - privacy compliance for cropped new images (#3673)
* feat: 3656 - privacy compliance for cropped new images

Impacted files:
* `background_task_image.dart`: now we crop here the image before sending it
* `new_crop_page.dart`: now we either let the server crop (old image) or let the background task crop (brand new image)
* `rotated_crop_controller.dart`: refactored adding a static method `getCroppedBitmap`

* feat: 3656 - bug fix - server gallery images should be considered as new images

Impacted files:
* `image_crop_page.dart`: minor refactoring
* `new_crop_page.dart`: minor refactoring
* `product_image_viewer.dart`: minor refactoring
* `uploaded_image_gallery.dart`: bug fix - we should consider that it's a new image
2023-02-05 17:36:22 +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