Impacted files:
* `background_task_add_price.dart`: minor refactoring
* `background_task_image.dart`: added `eraserCoordinates` field; moved here code about "eraser overlayPainter"
* `crop_helper.dart`: new methods `getEraserCoordinates` and `getOffsets`; minor refactoring
* `product_crop_helper.dart`: added "eraser" for "ProductType.product" only; minor refactoring
* `proof_crop_helper.dart`: minor refactoring
Impacted files:
* `image_compute_container.dart`: added the compression quality parameter
* `background_task_image.dart`: added the compression quality and force quality parameters; same parameters as before for OxF images (quality 100, no forced compression for non cropped images)
* `background_task_add_price.dart`: always compress the proof image, with quality 80
New file:
* `background_task_queue.dart`: Queues for Background Tasks.
Impacted files:
* `background_task.dart`: now we add tasks to a specific queue
* `background_task_add_other_price.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_add_price.dart`: assigned to `BackgroundTaskQueue.slow`
* `background_task_badge.dart`: minor refactoring
* `background_task_crop.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_details.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_download_products.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_full_refresh.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_hunger_games.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_image.dart`: assigned to `BackgroundTaskQueue.slow`
* `background_task_language_refresh.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_manager.dart`: now using new class `BackgroundTaskQueue` in order to use multiple queues
* `background_task_offline.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_refresh_later.dart`: assigned to `BackgroundTaskQueue.fast`
* `background_task_top_barcodes.dart`: assigned to `BackgroundTaskQueue.longHaul`
* `background_task_unselect.dart`: assigned to `BackgroundTaskQueue.fast`
* `dao_string_list.dart`: added 2 queues
* `local_database.dart`: now running all queues
* `local_database_mock.dart`: minor refactoring
* `offline_tasks_page.dart`: now taking queues into account
* `up_to_date_mixin.dart`: now running all queues
* `user_preferences_page.dart`: now running all queues
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
New files:
* `eraser_model.dart`: Model about the eraser tool: coordinate computations.
* `eraser_painter.dart`: Painter of the eraser tool: displaying thick lines.
Impacted files:
* `background_task_add_price.dart`: displaying the eraser bars if relevant; new `eraserCoordinates` field
* `background_task_image.dart`: minor refactoring
* `crop_helper.dart`: new `enableEraser` field `offsets` parameters
* `crop_page.dart`: added an erasing tool for proofs; refactored
* `crop_parameters.dart`: new `eraserCoordinates` parameter
* `operation_type.dart` unrelated minor refactoring
* `product_crop_helper.dart`: minor refactoring
* `product_price_item.dart`: unrelated fix for TEST env
* `proof_crop_helper.dart`: minor refactoring
* `pubspec.lock`: wtf
* `pubspec.yaml`: needed upgrade of `crop_image` to `1.0.13`
* 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)
* feat: 5195 - new "add one product price" page with background task
New files:
* `background_task_add_price.dart`: Background task about adding a product price.
* `currency_selector_helper.dart`: Helper for currency selection.
* `price_amount_card.dart`: Card that displays the amounts (discounted or not) for price adding.
* `price_amount_field.dart`: Text field that displays a single amount for price adding.
* `price_currency_card.dart`: Card that displays the currency for price adding.
* `price_currency_selector.dart`: Button that displays the currency for price adding.
* `price_date_card.dart`: Card that displays the date for price adding.
* `price_location_card.dart`: Card that displays the location for price adding.
* `price_model.dart`: Price Model (checks and background task call) for price adding.
* `price_proof_card.dart`: Card that displays the proof for price adding.
* `product_price_add_page.dart`: Single page that displays all the elements of price adding.
Impacted files:
* `app_en.arb`: added labels related to price adding
* `app_fr.arb`: added labels related to price adding
* `background_task_crop.dart`: minor refactoring
* `background_task_image.dart`: minor refactoring
* `background_task_upload.dart`: minor refactoring
* `currency_selector.dart`: refactored with new class `CurrencySelectorHelper`
* `dao_osm_location.dart`: minor refactoring
* `image_crop_page.dart`: minor refactoring
* `location_list_supplier.dart`: minor refactoring
* `location_map_page.dart`: added action buttons for location description and location confirmation
* `operation_type.dart`: added data for new class `BackgroundTaskAddPrice`
* `prices_card.dart`: now opening new page `ProductPriceAddPage`
* `product_price_item.dart`: minor improvement
* `product_prices_page.dart`: minor improvement
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded `openfoodfacts` to `3.10.0`
* `search_location_preloaded_item.dart`: now enabling the map page to confirm a location
* fine-tuning
Impacted files:
* `app_en.arb`: added labels related to prices
* `app_fr.arb`: added labels related to prices
* `edit_product_page.dart`: added a link to "Add product price" page
* `prices_card.dart`: refactoring
* `product_price_add_page.dart`: fixed the FAB label; refactored the access using a static method
* `product_price_item.dart`: now displaying the not discounted price; refactored
* `product_prices_list.dart`: localized
* `product_prices_page.dart`: added a FAB to "Add product price" page
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
* fix: 4663 - use the latest password for background tasks + refactoring
Impacted files:
* `background_task.dart`: use the latest password; now we compute user and country from that class, and language most of the time too
* `background_task_barcode.dart`: removed user and country parameters; replaced language
* `background_task_crop.dart`: removed user and country parameters; replaced language
* `background_task_details.dart`: removed user, language and country parameters
* `background_task_download_products.dart`: removed user, language and country parameters
* `background_task_full_refresh.dart`: removed user, language and country parameters
* `background_task_hunger_games.dart`: removed user, language and country parameters
* `background_task_image.dart`: removed user and country parameters; replaced language
* `background_task_offline.dart`: removed user, language and country parameters
* `background_task_paged.dart`: removed user, language and country parameters
* `background_task_progressing.dart`: removed user, language and country parameters
* `background_task_refresh_later.dart`: removed user, language and country parameters
* `background_task_top_barcodes.dart`: removed user, language and country parameters
* `background_task_unselect.dart`: removed user, language and country parameters
* `background_task_upload.dart`: removed user and country parameters; replaced language
* `paged_to_be_completed_product_query.dart`: minor refactoring
* `paged_user_product_query.dart`: minor refactoring
* fix: 4663 - lint fix
---------
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
* 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
Impacted files:
* `background_task_crop.dart`: now using new safe method `getFile` instead of just `File`
* `background_task_image.dart`: now using new safe method `getFile` instead of just `File`
* `background_task_upload.dart`: now fixing the ios directory
* `crop_page.dart`: now using a shared directory
Deleted files:
* `dao_hive_product.dart`: we don't store products in hive since 18 months ago
* `dao_unzipped_product.dart`: we don't store products as unzipped since 18 months ago
Impacted files:
* `background_task_hunger_games.dart`: impacted by off-dart new features
* `background_task_image.dart`: impacted by off-dart new features
* `crop_page.dart`: impacted by off-dart new features
* `local_database.dart`: removed hive and unzipped products
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
Impacted files:
* `app_en.arb`: added 2 labels for a "too small image" dialog!
* `background_task_image.dart`: now we check before server call if the image is big enough
* `crop_page.dart`: now we check if the image is big enough before new image upload
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgraded crop_image for controller bug fix
* fix: 4066 - top n product download split in smaller robust parts
New files:
* `background_offline_barcodes.dart`: Background subtask about pre-downloading top n barcodes.
* `background_offline_products.dart`: Background subtask about downloading products.
* `dao_work_barcode.dart`: Work table that contains barcodes.
Impacted files:
* `background_task_offline.dart`: now we clean the new `DaoWorkBarcode` and we just call the new `BackgroundtaskOfflineBarcodes`
* `local_database.dart`: upgraded to version 3, with the new `DaoWorkBarcode`.
* `operation_type.dart: added the new 2 background tasks.
TODO
* `backgrount_task_manager.dart`: make it possible to actually chain tasks with immediate execution
* Penultimate step before un-drafting
New files:
* `background_task_paged.dart`: Abstract background task with paged actions.
* `background_task_progressing.dart`: Abstract background task with work in progress actions.
Impacted files:
* `background_task_crop.dart`: minor refactoring
* `background_task_details.dart`: minor refactoring
* `background_task_hunger_games.dart`: minor refactoring
* `background_task_image.dart`: minor refactoring
* `background_task_refresh_later.dart`: minor refactoring
* `background_task_unselect.dart`: minor refactoring
* `background_task_upload.dart`: minor refactoring
* `dao_work_barcode.dart`: minor refactoring
* `edit_product_page.dart`: minor refactoring
* `local_database.dart`: minor refactoring
* `new_product_page.dart`: minor refactoring
* `offline_tasks_page.dart`: minor refactoring; displays progress percentage
* `operation_type.dart`: moved file; minor refactoring for progress percentage
* `product_image_gallery_view.dart`: minor refactoring
* `up_to_date_changes.dart`: minor refactoring
Later:
* `background_task.dart`
* `background_task_download_products.dart`
* `background_task_full_refresh.dart`
* `background_task_manager.dart`
* `background_task_offline.dart`
* `background_task_top_barcodes.dart`
* `offline_data_page.dart`
* Final commit for main features.
Impacted files:
* `app_en.arb`: added a label for topN download with parameter
* `background_task.dart`: added a bool getter for immediate exec of the next task; minor refactoring
* `background_task_download_products.dart`: now as a _progressing_ background task, reused for top N, with KP and without KP
* `background_task_full_refresh.dart`: now as a _paged_ background task, that opens two progressing download tasks (one with KP, one without KP)
* `background_task_manager.dart`: now working as singleton; added a special case for immediate exec of the next task
* `background_task_offline.dart`: now as a _progressing_ background task
* `background_task_top_barcodes.dart`: now as a _progressing_ background task
* `dao_work_barcodes.dart`: fixed the bulk insert and delete for more than 1K products (actually, 1K SQL parameters)
* `offline_data_page.dart`: now using topN and pageSize parameters
* `offline_tasks_page.dart`: added a "work" label for the tasks
* `operation_type.dart`: now embeds the "work" in the task id
* Update packages/smooth_app/lib/background/background_task_download_products.dart
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* Update packages/smooth_app/lib/background/background_task_download_products.dart
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* Update packages/smooth_app/lib/background/background_task_progressing.dart
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* Update packages/smooth_app/lib/background/background_task_progressing.dart
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* fix: 4066 - localization
---------
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* 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
Impacted files:
* `app_en.arb`: added 5 labels for the action progress on crop page
* `background_task_image.dart`: minor refactoring
* `crop_page.dart`: displays a text instead of a stuttering circular progress indicator; minor refatoring
* `image_compute_container.dart`: now using `compute` as much as possible - still not possible for `ui`
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
* 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`
* 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
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
New file:
* `image_compute_helper.dart`: Optimized methods for BMP and JPEG file computations.
Impacted files:
* `background_task_image.dart`: now using new optimized `saveJpeg` method
* `new_crop_page.dart`: now using new `saveBmp` method for performances; added a progress indicator; refactored
* `pubspec.lock`: wtf
* `pubspec.yaml`: added package `flutter_image_compress`; refactored
* `rotated_crop_image.dart`: fixed a bug regarding `dispose`
* 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
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
Impacted files:
* `background_task_image.dart`: added cropped file, rotation and crop parameters; now we upload the full image and then send the rotation/crop parameters to apply
* `new_crop_page.dart`: now we create two files - the full image, to be sent to the server with rotation/crop parameters, and a small cropped file, for the transient image; refactored
* `rotated_crop_controller.dart`: now we can crop into max-sized files
* `rotation.dart`: added helper methods for off-dart rotation/crop tool.
* fix: 3570 - background task order is now respected
Impacted files:
* `app_en.arb`: added a label for the "stop this task ASAP?" question and the corresponding task label
* `background_task_manager.dart`: fixed a bug where the task list was refreshed inappropriately; now it's possible to cancel a task; refactored
* `offline_tasks_page.dart`: now when you click on a task, you can stop it ASAP (for the record that does not mean immediately)
* fix: 3570 - better task cleaning when successful or dismissed
Impacted files:
* `abstract_background_task.dart`: added a "success?" parameter to `postExecute`
* `background_task_details.dart`: minor refactoring
* `background_task_image.dart`: made the distinction between a simple garbage collecting and a successful task run
* `background_task_manager.dart`: now we clean deeper when we remove a task
* `background_task_refresh_later.dart`: minor refactoring
* fix: 3533 - added a "stamp" to background tasks, to identify similar tasks
Impacted files:
* `abstract_background_task.dart`: added a stamp; minor refactoring
* `add_basic_details_page.dart`: implemented the background stamp
* `add_other_details_page.dart`: implemented the background stamp
* `background_task_details.dart`: new `enum BackgroundTaskDetailsStamp`; added the background stamp
* `background_task_image.dart`: added the background stamp
* `background_task_manager.dart`: refactored the run queue; stops when there's not internet connection
* `background_task_refresh_later.dart`: added the background stamp
* `edit_ingredients_page.dart`: added the background stamp
* `edit_new_packagings.dart`: implemented the background stamp
* `local_database.dart`: unrelated removal of deprecated comment
* `main.dart`: slightly related fix of #3522, because we used to run background tasks before the language was set
* `nutrition_page_loaded.dart`: implemented the background stamp
* `ocr_helper.dart`: added a background stamp
* `ocr_ingredients_helper.dart`: implemented the background stamp
* `ocr_packaging_helper.dart`: implemented the background stamp
* `simple_input_page.dart`: added the background stamp; now we split the updates in as many minimum parts as possible
* `simple_input_page_helpers.dart`: added and implemented background stamps; unrelated fix (when the widget is not displayed, the data should be considered as "not changed")
* fix: 3533 - added a 5 second delay between runs
Impacted files:
* `background_task_details.dart`: more verbose tags for stamps
* `background_task_image.dart`: added language to stamp
* `background_task_manager.dart`: added a 5 second minimum delay between runs; added temporary debug prints
* `edit_product_page.dart`: added a task refresh
* `product_image_gallery_view.dart`: added a task refresh
Impacted files:
* `background_task_image.dart`: explicitly deleting the file at the end of the task.
* `new_crop_page.dart`: changed the directory to a "not temporary" one
* `transient_file.dart`: finally only dealing with removing transient files, not the actual OS file
Impacted files:
* `background_task_image.dart`: throws an exception if the upload status is not OK
* `background_task_manager.dart`: logs a Sentry error if the executed background task throws an exception
* 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
New file:
* `background_task_refresh_later.dart`: Background task that triggers a product refresh "a bit later".
Impacted files:
* `abstract_background_task.dart`: added method `mayRunNow`, added the new `BackgroundTaskRefreshLater` class, minor refactoring
* `background_task_details.dart`: minor refactoring
* `background_task_image.dart`: added a "refresh later" task at the end, minor refactoring
* `background_task_manager.dart`: introduced the concept of delayed tasks with new method `mayRunNow`
* `new_product_page.dart`: added a call to background tasks here, as the app's arguably most important page
* `operation_type.dart`: added a new operation type - "refresh later"
Deleted file:
* `background_task_helper.dart`
New files:
* `background_task_manager.dart`: Management of background tasks: single thread, block, restart, display.
* `dao_instant_string.dart`: Where we store strings that need INSTANT access (= not lazy, no await).
Impacted fles:
* `abstract_background_task.dart`: refactored
* `background_task_details.dart`: refactored around the changes in `AbstractBackgroundTask`
* `background_task_image.dart`: refactored around the changes in `AbstractBackgroundTask`
* `dao_string_list.dart`: refactoring around now managing several lists; removed unnecessary `await` for a non-lazy dao
* `local_database.dart`: added the new class `DaoInstantString`; relaunch the background task manager at every refresh
* `main.dart`: minor refactoring
* `new_crop_page.dart`: unrelated bug fix
* `offline_tasks_page.dart`: refactored around the new `BackgroundTaskManager`
* `operation_type.dart`: added helper methods
* `product_image_gallery_view.dart`: minor refactoring
* `product_image_viewer.dart`: unrelated bug fix - the product was not refreshed, and so wasn't the image even after a successful download
* `pubspec.lock`: wtf
* `pubspec.yaml`: removed `flutter_task_manager`
* `search_history_view.dart`: minor refactoring now that we have several lists in `DaoStringList`
* `search_page.dart`: minor refactoring now that we have several lists in `DaoStringList`
* `up_to_date_changes.dart`: minor refactoring
* `up_to_date_product_provider.dart`: minor refactoring
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`
Deleted file:
* `picture_capture_helper.dart`: moved code to `ConfirmAndUploadPicture`, that is now the only place where we upload images
Impacted files:
* `add_new_product_page.dart`: minor refactoring
* `background_task_details.dart`: minor refactoring
* `background_task_image.dart`: minor refactoring
* `confirm_and_upload_picture.dart`: minor refactoring; moved here code from `picture_capture_helper.dart`
* `edit_ingredients_page.dart`: replaced `uploadCapturedPicture` with a call to page `ConfirmAndUploadPicture`
* `image_crop_page.dart`: refactored into a single `startImageCropping` method
* `image_upload_page.dart`: replaced `uploadCapturedPicture` with a call to page `ConfirmAndUploadPicture`
* `new_crop_page.dart`: minor refactoring
* `product_image_gallery_view.dart`: replaced `uploadCapturedPicture` with a call to page `ConfirmAndUploadPicture`; refactoring around refresh
* `product_image_viewer.dart`: minor refactoring
* `up_to_date_product_provider.dart: removed old-fashioned code
Impacted files:
* `abstract_background_task.dart`: refactored around the `upload` method
* `background_task_details.dart`: now implements the new `upload` method
* `background_task_image.dart`: now implements the new `upload` method
* `product_refresher.dart`: removed now useless method `saveAndRefresh`
Co-authored-by: Aman Raj <57723319+AshAman999@users.noreply.github.com>
New files:
* `abstract_background_task.dart`: Abstract background task.
* `background_task_details.dart`: Background task that changes product details (data, but no image upload).
* `background_task_image.dart`: Background task about product image upload.
Impacted files:
* `add_basic_details_page.dart`: refactored the call to background task; minor refactoring
* `background_task_helper.dart`: moved most of the code to new classes `AbstractBackgroundTask` and offsprings.
* `edit_ingredients_page.dart`: refactored the call to background task
* `nutrition_page_loaded.dart`: refactored the call to background task
* `picture_capture_helper.dart`: refactored the call to background task
* `simple_input_page.dart`: refactored the call to background task
* `simple_input_page_helpers.dart`: added and implemented method `getTask`