New file:
* `work_type.dart`: Type of long download work for some background tasks.
Impacted files:
* `background_task.dart`: removed the default `uriProductHelper` getter
* `background_task_barcode.dart`: added a `uriProductHelper` getter that depends on the `productType`
* `background_task_download_products.dart`: refactored the access to product type
* `background_task_full_refresh.dart`: split by product type
* `background_task_language_refresh.dart`: split by product type
* `background_task_offline.dart`: refactored the access to product type
* `background_task_progressing.dart`: added the `productType` parameter; moved code to new `WorkType` class
* `background_task_top_barcodes.dart`: refactored the access to product type
* `dao_product.dart`: new methods `getProductTypes` and `splitAllProducts`; refactored with product type
* `lazy_counter.dart`: explicitly counting the "food" products
* `newsfeed_provider.dart`: explicitly getting the news from "food"
* `offline_data_page.dart`: now displaying "download top N products" buttons for each product type; stats for each product type
* `offline_tasks_page.dart`: enhanced "work text" algo, now depending on product type
* `operation_type.dart`: enhanced "key" algo, now depending on product type
* `ordered_nutrients_cache.dart`: explicitly using the "food" nutrients
* `product_list_page.dart`: now reloading products from their server
* `product_list_popup_items.dart`: now linking to the first server with products
* `product_query.dart`: made product type a mandatory parameter
* `product_refresher.dart`: added mandatory parameter product type
* `random_questions_query.dart`: explicitly ask for "food" robotoff products
* `temp_product_list_share_helper.dart`: added mandatory parameter product type
* `user_preferences_dev_debug_info.dart`: added explicit use of "food" data
New file:
* `dao_product_last_access.dart`: Table that stores the local last access timestamp for a product.
Impacted files:
* `local_database.dart`: new version of the database, because of the new "product last access" table
* `new_product_page.dart`: added a call to refresh the product "last access" timestamp
* `offline_data_page.dart`: added a call to delete the product "last access" timestamps
* `product_model.dart`: added a call to refresh the product "last access" timestamp
* `pubspec.lock`: wtf
* 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
* 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:
* `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';`
* 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
* 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>
* initial page build
* functions to calculate size and total number of products
and also deleting products from db
* helper functions added
* removed unnessary comment
* variable rename and comment add
* code refactor
* better comments
* translations added
* function rename
* minor fixes
* better comments style