72 Commits

Author SHA1 Message Date
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
9208f6612c fix: 6640 - removed misleading "unsupported barcode" scan card (#6659) 2025-06-20 10:01:30 +02:00
ebe2af81b4 A valid product needs to have photos (otherwise, we consider it as new) (#6191) 2025-03-03 18:28:57 +01:00
87b51cca44 Ignore invalid barcodes (#6108) 2025-01-04 11:52:19 +01:00
3655c3b300 feat: Scan cards share the same UI (#5866)
* Harmonized UI for scan cards

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

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>

* Fix build issue

---------

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
2024-11-18 15:24:05 +01:00
f79bae611f feat: 4423 - specific "Not connected to internet" displayed error (#4455)
* 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
2023-08-16 12:01:25 +02:00
097a905393 feat: Some improvements for the carousel (changing pages, a11n…) (#4225)
* 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>
2023-06-25 17:46:50 +02:00
e4a02f8d10 Scanner: when the compare mode is visible, ensure the visor is not covered by the header (#4229) 2023-06-25 10:57:32 +02:00
421661ca41 feat: The compare feature only accepts two existing products (#4139)
* The compare feature only accepts two existing products

* Update packages/smooth_app/lib/helpers/collections_helper.dart

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

---------

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2023-06-15 12:24:12 +02:00
e2197d167c feat: 3719 - new "scan history" page among the account product lists (#4029)
Impacted files:
* `app_en.arb`: added 1 label for "scan history"
* `continuous_scan_model.dart`: added the product to "scan history"
* `product_list.dart`: added "scan history"; refactored `ProductListType`
* `product_list_page.dart`: added "scan history"
* `product_query_page_helper.dart`: added "scan history"
* `user_preferences_account.dart`: added an access to the "scan history" page
2023-05-27 14:35:49 +02:00
726b5d438d The scanner may return cropped barcodes. (#4030)
We try to fix them with a simple algorithm for now
2023-05-27 14:23:40 +02:00
7e861f569e refactor: upgrade to off-dart 2.0.0 (#3495)
Impacted files:
* `paged_to_be_completed_product_query.dart`: renamed `State` as `ProductState`
* `paged_user_product_query.dart`: created local `UserSearchType` instead of deprecated off-dart `UserProductSearchType`; used `ProductSearchQueryConfiguration` instead of deprecated `UserProductSearchQueryConfiguration`
* `product_query.dart`: now that we use fully v3, we don't need the temporary field list for user-related queries with v2
* `pubspec.lock`: wtf
* `pubspec.yaml`: upgrade to off-dart 2.0.0
* `user_preferences_account.dart`: now using new local class `UserSearchType`
* and reduced all off-dart imports to a single `import 'package:openfoodfacts/openfoodfacts.dart';`
2023-01-02 16:10:52 +01:00
4a3b1a90b4 chore: Add dev mode setting to add cards to the scanner (#3400)
* chore: Add dev mode setting to add cards to the scanner

* Update packages/smooth_app/lib/pages/preferences/user_preferences_dev_mode.dart
2022-12-02 17:37:22 +01:00
1996907f74 chore: Matomo refactor (#3273)
* chore: Matomo refactor

* ci: add labeler for analytics

* fix: Review

Co-Authored-By: monsieurtanuki <11576431+monsieurtanuki@users.noreply.github.com>

* Revert play dart run

* Rename + added comments

Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
Co-authored-by: monsieurtanuki <11576431+monsieurtanuki@users.noreply.github.com>
2022-11-08 18:02:53 +01:00
cf4fa6aebe fix: Background image upload (#2433)
* 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>
2022-09-01 12:15:09 +02:00
d922511a32 feat: #2785 - async access to dao product list (#2788)
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
2022-08-16 18:48:36 +02:00
ae75c50709 If the latest barcode is removed from the carousel, it should be scannable again (#2746)
Co-authored-by: Marvin Möltgen <39344769+M123-dev@users.noreply.github.com>
2022-08-08 13:22:26 +02:00
115722b613 feat: #2396 - better memory management - load products only when needed (#2609)
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`
2022-07-25 08:12:04 +02:00
68d7c5484d fix: double-response mechanism in the scan screen (#2632)
* double-response mechanism in the scan screen

* specify exception type

* removed old unused method and timeout set
2022-07-21 15:45:33 +02:00
9e253a774f feat: #2339 - added language and country to query product list keys (#2465)
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
2022-07-02 15:44:56 +02:00
061fa6ede4 fix: #2362 history not refreshing (#2393)
* fix: #2362 history not refreshing

* fix:#2362 refactoring codereview

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
2022-06-30 21:15:48 +02:00
8ddb7260b6 fix: #1973 new product in carousel (#2391) 2022-06-30 10:01:47 +02:00
c1664d67b7 feat: #2248 - user agent distinction between scan and barcode search (#2408)
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
2022-06-28 09:17:34 +02:00
1bb7a2fefe fix: #2128 add new card disappears (#2232)
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2022-06-27 15:11:32 +02:00
97d36bc71c feat: Logs service (+ email attachment) (#2303)
* Logs service (+ email attachment)

* Fix flutter format warning

* Reformat code

* Remove fimber_io dependency to have our own implementations instead

* Add close:true to email dialog

* Add SENDTO query to AndroidManifest

* Remove useless comment
2022-06-23 15:14:28 +02:00
5715cf7171 fix: #1427 scanning invalid code (#2336)
* fix: #1427 scan invalid code

* fix: #1427 fix presubmit test
2022-06-22 15:56:19 +02:00
ca1fa29ea2 feat: Scanner improvements (#1781)
* 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
2022-05-11 16:49:58 +02:00
342c5f18dc feat: #1501 - split of the preference page into detailed pages (#1797)
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
2022-05-10 20:53:34 +02:00
ddc1bac73c feat: Remove individual product from the scan carousel (#1662)
* feat: Remove individual product from the scan carousel

* updated UI as per mocks
2022-04-28 10:59:33 +02:00
e08e8131b4 fix: #1139 - carousel spinning issues (#1604) 2022-04-25 17:11:25 +02:00
536528dbe1 fix: #1395 - show newly added product in carousel (#1520)
* fix: #1395 - show newly added product in carousel

* fix: #1395 - refactoring unused import

* fix: #1395 - refactoring make variable private
2022-04-11 15:51:25 +02:00
7bf48b0200 feat: #1034 - tap to open search card (#1502) 2022-04-07 10:25:09 +02:00
000c2bed99 fix: Scanner buttons not updated (#1140)
* fix: Scanner buttons not updated

* Refactor: Own file for ScanHeader
2022-02-18 17:21:39 +01:00
7783e412e2 feat: Added core usage logging (#1147)
* feat: Initial tracking structure

* Added testing page

* Created track constructor

* Deleted unneccassary _trackConstructor params

* Finished start track

* Fix id + country

* Finished: trackScannedProduct

* Finished: trackProductPageOpen

* Finished: trackKnowledgePanelOpen

* Finished: trackOpenLink

* Finished: trackPersonalizedRanking

* Finished: trackSearch

* Added documentation + fixed imports

* Code review

* trackKnowledgePanelOpen

* Code review

* Update main.dart
2022-02-18 17:01:14 +01:00
a1e8221edc feat: Add retry button in case of Internet Error (#1105)
* 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
2022-02-11 23:48:10 +01:00
a4f623aeb9 fix: #1048 - added the scanned product to history (#1049)
Impacted file:
* `continuous_scan_model.dart`: added the scanned product to history
2022-01-31 16:43:12 +01:00
4a85c62af4 feat: ML Kit scanner (#893)
* 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>
2022-01-12 18:54:50 +01:00
2262b4e3be feature/#782 - now using the onboarding's country and global country and language for API searches (#783)
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
2021-12-29 11:06:50 +01:00
572b441813 feat: Use visibility_detector to detect if camera is open (#730)
* feat: Use visibility_detector to detect if camera is open

* Update tab_navigator.dart

* Update pubspec.lock

* Update continuous_scan_page.dart
2021-12-15 19:36:45 +01:00
368758d0b1 refactor: removal of the old version of ProductPage; OFF language and country (#729)
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`
2021-12-15 15:53:41 +01:00
c2d3b85a3b fix: Wrong null check in scanner (#724) 2021-12-13 18:19:46 +01:00
ca3739ec71 feat: #681 Stateful tabs (#703)
* 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>
2021-12-11 12:54:01 +01:00
5c7d1485de feat: #470 - hive instead of sqflite, and no more pantries and colors (#717)
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
2021-12-10 15:58:25 +01:00
61576ded71 fix: deprecated share package + analyzer warnings (#656) 2021-11-15 15:49:58 +01:00
d5cdba0336 Update scan page as per the UX spec (well, roughly) (#659) 2021-11-15 14:44:51 +01:00
e33a46e6c4 bug/#628 - notion of "FetchedProduct" for better control over internet errors (#630)
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
2021-10-26 09:21:34 +02:00
2ce940b319 feature_4/#461 - added the long click and the swipe features to ranking page (#471)
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
2021-08-03 11:47:48 +02:00
df197818f3 feature_3/#461 - added a clearable scan feature (#469)
* 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>
2021-07-28 18:42:18 +02:00
48fcc21bc0 feature_2/#461 - fixed product order for scanned products in dedicated page (#468)
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
2021-07-27 19:46:44 +02:00
65386e9155 Merge Changes 2021-07-23 09:59:05 -07:00