* feat: 4423 - specific "Not connected to internet" displayed error
Impacted files:
* `barcode_product_query.dart`: removed useless `try` as already `catch`'ed
* `continuous_scan_model.dart`: removed the `codeInvalid` case that could never happen
* `fetched_product.dart`: refactored with explicit constructors and additional exception and connectivity fields; removed the `codeInvalid` case that could never happen
* `new_product_page.dart`: minor refactoring
* `product_dialog_helper.dart`: removed the `codeInvalid` case that could never happen; minor refactoting
* `product_list_item_simple.dart`: removed the `codeInvalid` case that could never happen
* `product_loader_page.dart`: removed useless `try` as already `catch`'ed
* `product_refresher.dart`: added a specific "You're not connected to the internet" error message; refactored using more `FetchedProduct`; removed useless method
* `pubspec.lock`: wtf
* `pubspec.yaml`: added package `connectivity_plus`
* `question_card.dart`: refactored using `FetchedProduct`
* feat: 4423 - fixed pubspec.yaml
* feat: 4423 - new "server down" message after a ping attempt
Impacted files:
* `fetched_product.dart`: added field `failedPingedHost` where we store the host that we couldn't ping
* `generated_plugin_registrant.cc`: wtf
* `generated_plugins.cmake`: wtf
* `GeneratedPluginRegistrant.swift`: wtf
* `main.dart`: registered `DartPingIOS`
* `product_refresher.dart`: now trying to ping the server if exception and connection
* `pubspec.lock`: wtf
* `pubspec.yaml: added packages `dart_ping` and `dart_ping_ios`
* feat: 4423 - stupid lint check part 1
* feat: 4423 - stupid lint check part 2
* feat: 4423 - stupid lint check part 3
* feat: 4423 - stupid lint check part 5
* feat: 4423 - localizations
Impacted files:
* `app_en.arb`: 4 new labels when we couldn't retrieve a product (not found, no internet, server down, server error)
* `product_refresher.dart`: used the new labels
* Some improvements for the carousel (changing pages, a11n…)
* Translate the announcement in english + remove unused translations used by the old scanner
* Update packages/smooth_app/lib/l10n/app_en.arb
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
---------
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
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';`
* work manager used for bg schedule
* removed swith case
* remove unwanted contrains and randomize the taskid
as image.others might fail
* added translations
* new product image upload working
* removed debug for work manager
* delete photo when uploaded
* use await keywords while initializing
* refactor the code
* fix show image after queed
* serialize and deserialze input data seperately
* add an instant product in the loacl db to
let the user not confuse
* added smooth random class
* use smooth random to generate 8 digits
* remove unneccesary await
* update the local db with a product if not yet
uploaded
* update local databse after sucessful
update into server
* don't refresh automatically after upload queed
* supply language code to work manager
* import app localizations
* small refactoring
* refactor the code for work manager
* iOS Config for WorkManager
* formatting
* suggestion by tolemon
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* suggestion by tolemon
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* suggestion by tolemon
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* small fix
* add swith case to the workmanager
* efficient switch case
* Update packages/smooth_app/lib/l10n/app_en.arb
Suggested by tolemon
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
* minor fix
* Basic Input details add are now run in background
* basic details are now updated immediatly
even without internet
* nutrient edit task are now background
and also conflict when recheduling task is managed
* menu screen for background tasks and
nutrition edits are now backgrounded
* button for retry now works in the bg tasks screen
* formatting
* genaralised function for non image tasks
* should retry set default to false
* better mechanism for retries and refactor
* refactor and consts duration of 3s for snackbars
* now language country and user are properly dropped
* Update packages/smooth_app/ios/Runner/Info.plist
* Update packages/smooth_app/ios/Runner/AppDelegate.swift
* Error messages fixed
* custom workmanager dependencies added
* migrated basic detail task from work manager to
taskmanager
* chanages to do the product edit changes in bg
* dart format
* cleaned the function calls when doing bg task
* dao_task edited
* unnecessary methods removed
* use int as id instead of string
* added comments and made fields final
* used const variable instead of hardcoded ones
* get pending tasks from taskManager class
* refactor
* handled exceptions
* string instead of int
* remove unused plugin
* removed unnessary files
* update to localdatabase working without islotes
* suggestions left as comments on PR
* deleted unncessary Random class
* doc added
* Remove WorkManager iOS code
* reset publock
* reset publock
* remove harcoded color
* used duration constant class instead of harcoded
* make methods to generate taskId
* dart frmt
* changes as per the code review
* string buffer , var documentation and rename
* error fix
* refactor and spelling corrections
* /// instead of //
* dart ff formater
* more refactorings
* Update background_task_helper.dart
* dart ff fix
Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
Co-authored-by: Edouard Marquez <g123k@users.noreply.github.com>
Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
Impacted files:
* `all_user_product_list_page.dart`: split in a not-loaded / loaded version; computes each user list length with a `FutureBuilder
* `continuous_scan_model.dart`: minor refactoring
* `dao_product_list.dart`: switch from "box" to "lazyBox" in order to cleanly make all methods `async`
* `new_product_page.dart`: now loading lists with `FutureBuilder`
* `paged_product_query.dart`: replaced deprecated methods
* `paged_to_be_completed_product_query.dart`: replaced deprecated methods
* `product_list_import_export.dart`: replaced deprecated methods
* `product_list_page.dart`: minor refactoring; replaced deprecated methods
* `product_list_supplier.dart`: minor refactoring
* `product_list_user_dialog_helper.dart`: now explicitly calling `notifyListeners` as `setState` won't be enough because of pre-loaded data
* `pubspec.lock`: generated
* `pubspec.yaml`: upgrade to `openfoodfacts: ^1.24.0`
* `query_product_list_supplier.dart`: minor refactoring
Deleted files:
* `scan_page_helper.dart`: refactored as there was only a single small method there, with a lousy "ignore" management.
* `smooth_main_button.dart`: old redundant button that did not fit the latest UI
New files:
* `personalized_ranking_model.dart`: Model that computes the scores and sorts the barcodes accordingly.
* `product_model.dart`: Model for product database get and refresh.
* `scan_product_card_loader.dart`: Display of product for the scan page, after async load from local database.
* `tmp_matched_product_v2.dart`: to be merged into off-dart
Impacted files:
* `app_en.arb`: added a label for "refresh_with_new_preferences"
* `app_fr.arb`: added a label for "refresh_with_new_preferences"
* `continuous_scan_model.dart`: now we don't store Product and we let the product cards get the product from the local db if and only if needed
* `dao_product.dart`: minor refactoring
* `dao_product_list.dart`: now we don't deal with products anymore, just barcodes.
* `group_query_filter_view.dart`: removed deprecated `SmoothMainButton`
* `partial_product_list.dart`: now we don't deal with products anymore, just barcodes.
* `personalized_ranking_page.dart`: now uses new class `PersonalizedRankingModel` for better refresh and async product load; now using appropriate button with localized label; fixed dismiss action
* `product_list.dart`: now we don't deal with products anymore, just barcodes.
* `product_list_import_export.dart`: refactored
* `product_list_item_simple.dart`: now we `async`ly load the product from the local database, and keep it refreshed for every change; now based on new class `ProductModel`; added sentry error calls; typo fix
* `product_list_page.dart`: now we don't store Product and we let the product cards get the product from the local db if and only if needed
* `product_preferences.dart`: new method `getCompactView` used to know if something changed.
* `product_query_model.dart`: now we include the "category" process in the model, and we don't store products.
* `product_query_page.dart`: removed useless and inactive sliver effect and `Hero`; refactored
* `product_query_page_helper.dart`: removed bug generating `Hero`
* `scan_header.dart`: refactored from `scan_page_helper.dart` being removed and slightly modified
* `search_page.dart`: removed bug generating `Hero`
* `smooth_product_carousel.dart`: now we async'ly load product from local database, and don't store them in memory.
* `summary_card.dart`: removed bug generating `Hero`
* `up_to_date_product_provider.dart`: added timestamps for new method `needsRefresh`
* `user_preferences_account.dart`: removed bug generating `Hero`
What:
* added language and country to query product list keys
* that means that if I run a query for "pizza", not only the results will be different depending on the language and country (that was already the case), but the results will be cached accordingly - if I change language or country, I will see the cached results for those new language/country, not the results of the same query but with different language/country
* we needed that improvement in order to display correctly the "world" results; that was the first step
* also moved all the "query" classes to a specific folder
* fun fact: there are more "pizza"s in France than in Italy
Impacted files:
* `abstract_onboarding_data.dart`: minor refactoring
* `barcode_product_query.dart`: moved; minor refactoring
* `category_product_query.dart`: moved; added language and country to product list key
* `continuous_scan_model.dart`: minor refactoring
* `country_selector.dart`: minor refactoring
* `database_product_list_supplier.dart`: minor refactoring
* `keywords_product_query.dart`: moved; added language and country to product list key
* `main.dart`: minor refactoring
* `new_product_page.dart`: minor refactoring
* `nutrition_page_loaded.dart`: minor refactoring
* `ocr_helper.dart`: minor refactoring
* `onboarding_data_product.dart`: minor refactoring
* `ordered_nutrients_cache.dart`: minor refactoring
* `paged_product_query.dart`: moved; added language and country to product list key; refactored around `getProducts`
* `paged_search_product_query.dart`: moved; refactored
* `paged_to_be_completed_product_query.dart`: moved; added language and country to product list key; refactored
* `paged_user_product_query.dart`: moved; added language to product list key; refactored
* `picture_capture_helper.dart`: minor refactoring
* `product_dialog_helper.dart`: minor refactoring
* `product_list.dart`: added optional language and country to constructor parameters
* `product_list_import_export.dart`: minor refactoring
* `product_list_page.dart`: minor refactoring
* `product_list_supplier.dart`: minor refactoring
* `product_query.dart`: moved; not an interface anymore
* `product_query_model.dart`: minor refactoring
* `product_query_page_helper.dart`: minor refactoring
* `product_refresher.dart`: minor refactoring
* `query_product_list_supplier.dart`: minor refactoring
* `robotoff_insight_helper.dart`: minor refactoring
* `robotoff_questions_query.dart`: moved; minor refactoring
* `search_page.dart`: minor refactoring
* `simple_input_page_helpers.dart`: minor refactoring
* `summary_card.dart`: minor refactoring
* `user_preferences_account.dart`: minor refactoring
* `user_preferences_dev_mode.dart`: minor refactoring
Impacted files:
* `barcode_product_query.dart`: new parameter `isScanned` to distinguish scan and barcode search via the user agent comment field
* `continuous_scan_model.dart`: "this IS a scan"
* `product_dialog_helper.dart`: "this is NOT a scan"
* `product_query.dart`: new method to set the user agent comment field
* All barcode detections are now computed in an Isolate
* Add a setStateSafe method
* Only accept 1D barcodes
* Between each decoding a window is passed
* Let's try to reduce a little bit the quality of the camera
* Improve a little bit the documentation
* Fix a typo
* Fix some typos
* Fixes issues highlighted by MonsieurTanuki in the PR
* Remove irrelevant `mount` check
* Fix wrong import
Deleted files:
* `faq_handle_view.dart`
* `list_helper.dart`
* `smooth_list_tile.dart`
* `social_handle_view.dart`
* `user_contribution_view.dart`
New files:
* `abstract_collapsible_user_preferences.dart`: Abstraction of a collapsed/expanded display for the preference pages.
* `all_user_product_list_page.dart`: Page that lists all user product lists.
* `user_preferences_connect.dart`: Display of "Connect" for the preferences page.
* `user_preferences_contribute.dart`: Display of "Contribute" for the preferences page.
* `user_preferences_faq.dart`: Display of "FAQ" for the preferences page.
* `user_preferences_list_tile.dart`: Custom `ListTile` for preferences.
Impacted files:
* `abstract_user_preferences.dart`: refactoring around the fact that now we display pages instead of collapsible List<Widget>
* `continuous_scan_model.dart`: refactored around `DaoProductList` being seldom `async`
* `dao_product_list.dart`: new method `getLength`; refactored with less `async` methods
* `new_product_page.dart`: refactored around `DaoProductList` being seldom `async`
* `preferences_page.dart`: minor refactoring
* `product_list_import_export.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_page.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_supplier.dart`: refactored around `DaoProductList` being seldom `async`
* `product_list_user_dialog_helper.dart`: new "delete list?" dialog; refactored around `DaoProductList` being seldom `async`
* `query_product_list_supplier.dart`: refactored around `DaoProductList` being seldom `async`
* `user_preferences_attribute_group.dart`: minor refactoring
* `user_preferences_dev_mode.dart`: minor refactoring
* `user_preferences_food.dart`: minor refactoring
* `user_preferences_page.dart`: now we use the same `StatefulWidget` for a root page with only headers and detailed pages with bodies; added item "Lists"; created 3 new "top paragraphs" extracted from "settings".
* `user_preferences_page-blue-dark.dart`: impacted by new page design
* `user_preferences_page-blue-light.dart`: impacted by new page design
* `user_preferences_page-brown-dark.dart`: impacted by new page design
* `user_preferences_page-brown-light.dart`: impacted by new page design
* `user_preferences_page-green-dark.dart`: impacted by new page design
* `user_preferences_page-green-light.dart`: impacted by new page design
* `user_preferences_profile.dart`: minor refactoring
* `user_preferences_settings.dart`: minor refactoring
* feat: add string for retry button
* feat: add method to reload barcode information on internet error
* feat: update localizations and add retry button
* chore: make setBarcodeState private
* feat: Working ML-Kit scanner without adding to ContinuousScanModel
* feat: Fully working ml kit scanner
* Cleanup
* Cleanup + documenting
* Update ml_kit_scan_page.dart
* More abstraction
* Stackoverflow link
* Update ml_kit_scan_page.dart
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
Impacted files:
* `barcode_product_query.dart`: now using global country and language
* `continuous_scan_model.dart`: now using implicitly global country and language
* `country_selector.dart`: fixed the initial country search (lowercase); now setting global country
* `image_upload_card.dart`: now using global language
* `keywords_product_query.dart`: now using global country and language
* `knowledge_panels_query.dart`: now using global country and language
* `main.dart`: now setting global country and language at init time
* `new_product_page.dart`: now using implicitly global country and language
* `product_dialog_helper.dart`: now using implicitly global country and language
* `product_query.dart`: added getter and setter for global country and language
* `smooth_app/pubspec.yaml`: upgraded to 1.8.1 off-dart, therefore we can remove the `dependency_overrides` fix
* `smooth_app/pubspec.lock`: impacted by `pubspec.yaml`
* `smooth_ui_library/pubspec.yaml`: upgraded to 1.8.1 off-dart
* `smooth_ui_library/pubspec.lock`: impacted by `pubspec.yaml`
* `example/pubspec.yaml`: unrelated minor upgrades
* `example/pubspec.lock`: impacted by `pubspec.yaml`
* `scan_page.dart`: now using implicitly global country and language
* `search_page.dart`: now using implicitly global country and language
* `user_preferences.dart`: minor refactoring
Deleted files:
* `attribute_card.dart`
* `attribute_list_expandable.dart`
* `category_card.dart`
* `category_chip.dart`
* `category_product_query.dart`
* `choose_page.dart`
* `group_product_query.dart`
* `product_page.dart`
* `smooth_expandable_card.dart`
* `subcategory_card.dart`
* `text_search_widget.dart`
Impacted files:
* `barcode_product_query.dart`: now using OFF classes for language and country instead of `String`s
* `continuous_scan_model.dart`: now using OFF classes for language and country instead of `String`s
* `keywords_product_query.dart`: now using OFF classes for language and country instead of `String`s
* `knowlegde_panel_query.dart`: now using OFF classes for country instead of `String`
* `product_cards_helper.dart`: moved here method from now defunct `AttributeListExpandable`
* `product_dialog_helper.dart`: now using OFF classes for language and country instead of `String`s
* `product_query.dart`: now computing values for OFF classes for language and country instead of `String`s
* `pubspec.yaml`: removed now useless libraries `flutter_staggered_animations`, `flutter_staggered_grid_view`, `flutter_typeahead` and `share_plus`, and upgraded some version numbers
* `scan_page.dart`: now using OFF classes for language and country instead of `String`s
* `search_page.dart`: moved methods from now defunct `ChoosePage`
* `smooth_product_card_found.dart`: removed an never used "old style" version; use a method moved to `product_dialog_helper.dart`
* `smooth_ui_library.dart`: removed the entry about now defunct `smooth_expandable_card.dart`
* `summary_card.dart`: use a method moved to `product_dialog_helper.dart`
* feat: first working stateful tab
* feat: enum instead of String
* Update tab_navigator.dart
* feat: Working camera disable for other tabs
* fix: #640 stop camera when navigating further in the stack
* doc + null safety
* fix: activating scanner when rebuilding from ground up
* Updated goldens
The navbar got removed from the images because it is now not directly added by the pages anymore
* doc:
* Minor changes
* fix: Updating product with multiple navigators
* Minor fixes
* Simplification
* Simplification
* Simplification
* Update main.dart
* Update product_list_page.dart
Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
Deleted files:
* `bulk_deletable.dart`
* `bulk_insertable.dart`
* `bulk_manager.dart`
* `dao_product_extra.dart`
* `label_sneek_peak_view.dart`
* `list_page.dart`
* `multi_product_select_page.dart`
* `product_copy_helper.dart`
* `product_copy_view.dart`
* `product_extra.dart`
* `product_list_add_button.dart`
* `product_list_button.dart`
* `product_list_item.dart`
* `product_list_item_pantry.dart`
* `product_list_item_shopping.dart`
* `product_list_preview.dart`
* `product_list_preview_helper.dart`
Impacted files:
* `abstract_dao.dart`: added hive related init methods
* `barcode_product_query.dart`: minor refactoring
* `category_product_query.dart`: minor refactoring
* `continuous_scan_model.dart`: minor refactoring
* `dao_product.dart`: rewritten from scratch with hive instead of sqflite - much easier to understand!
* `dao_product_list.dart`: rewritten from scratch with hive instead of sqflite - much easier to understand!
* `dao_string_list.dart` (renamed from `search_history.dart`): rewritten from scratch with hive instead of sqflite
* `database_product_list_supplier.dart`: minor refactoring
* `group_product_query.dart`: minor refactoring
* `history_page.dart`: minor refactoring
* `keywords_product_query.dart`: minor refactoring
* `local_database.dart`: rewritten from scratch with hive instead of sqflite; simplified
* `main.dart`: minor refactoring
* `new_product_page.dart`: minor refactoring
* `personalized_ranking_page.dart`: removed old feature
* `product_list.dart`: preferred `enum` to `String` for types; removed tons of old features
* `product_list_dialog_helper.dart`: removed old feature
* `product_list_item_simple.dart`: removed old features
* `product_list_page.dart`: removed old features
* `product_page.dart`: removed old feature
* `product_query_page_helper.dart`: cleaner code with `enum`s
* `pubspec.yaml`: added hive, removed sqflite
* `query_product_list_supplier.dart`: minor refactoring
* `search_history_view.dart`: minor refactoring
* `search_page.dart`: minor refactoring
New files:
* `fetched_product.dart`: combo of Product and its fetch status
* `smooth_product_card_error.dart`: Product Card when an exception is caught
Impacted files:
* `app_en.arb`: added translations for "internet error" and "canceled by user"
* `barcode_product_query.dart`: now using `FetchedProduct` instead of `Product`
* `choose_page.dart`: now using `FetchedProduct` instead of `Product`
* `continuous_scan_model.dart`: new value `ScannedProductState.ERROR`, used when an exception is caught during API call; now using `FetchedProduct` instead of `Product`
* `new_product_page.dart`: now using `FetchedProduct` instead of `Product`
* `product_dialog_helper.dart`: now using `FetchedProduct` instead of `Product`
* `product_page.dart`: now using `FetchedProduct` instead of `Product`
* `smooth_product_card_error.dart`: added an explicit message
* `smooth_product_carousel.dart`: handling the `ScannedProductState.ERROR` case
Also removed further "contribution" code.
Deleted files:
* `contribution_page.dart`: removed "contribution" code
* `smooth_product_card_edit.dart`: removed "contribution" code
Impacted files:
* `continuous_scan_model.dart`: refactored the "refresh"; removed "contribution" code
* `continuous_scan_page.dart`: refreshes the model after going to "ranking" page, where items can now be removed
* `home_page.dart`: removed "contribution" code
* `personalized_ranking_page.dart`: added the long click and the swipe features
* `product_list_page.dart`: refreshes after going to "ranking" page, where items can now be removed
* `scan_page.dart`: removed "contribution" code
* `smooth_product_carousel.dart`: refactored for a tricky moment where the length is not updated but deleted items are still potentially displayed; removed "contribution" code
* feature_3/#461 - added a clearable scan feature
Deleted file:
* `smoothie.svg`: replaced by identical `Icons.emoji_events_outlined`
Impacted files:
* `category_card.dart`: unrelated replacement of 'smoothie.svg'
* `continuous_scan_model.dart`: added method `clearScanSession`; refactored
* `continuous_scan_page.dart`: replaced FAB with buttons "clear" and "ranking"; added a message when empty
* `dao_product_extra.dart`: handles the new "scan session" list; added method `clearScanSession`
* `dao_product_list.dart`: refactored
* `home_page.dart`: refactored
* `product_list.dart`: introduced the new "scan session" list type and renamed the previous "scan history" list type; refactored
* `product_list_page.dart`: handles the new "scan session" list; replacement of 'smoothie.svg'
* `product_query_page.dart`: replacement of 'smoothie.svg'
* `product_query_page_helper.dart`: handles the new "scan session" list
* `scan_page.dart`: removed the "Choose/Contribute" toggle button
* `smooth_view_finder.dart`: removed label "Powered by Open Food Facts"
* Update packages/smooth_app/lib/pages/scan/continuous_scan_page.dart
Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org>
Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org>
Impacted files:
* `continuous_scan_model.dart`: reversing the order (= no change in display)
* `dao_product_extra.dart`: reversing the order of scanned products - the order is now from newer to older