-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nutrition input (Tracker) #511
Comments
@monsieurtanuki would you take on Nutrition ? |
I'm afraid not, I cannot use the camera. The camera is the main item here, isn't it? If it's not, I can work on the input of a nutrient list, and someone else would do the camera side later. Tell me if that makes sense. |
No, the photo here is an existing nutrition photo. The layout is immersive and scrollable to make it easy to improve nutrition. The photo retaking is for a later iteration. |
So it's really the input of the nutrients list, with a fancy layout. We can start simpler. |
But to be clear it's a big chew:
|
OK, I'll do it step by step. |
@teolemon How are we supposed to open that page? From product page I guess, but where should one click? |
|
@monsieurtanuki wouldn't the second one do the trick ? Also: https://stackoverflow.com/questions/49577781/how-to-create-number-input-field-in-flutter |
@teolemon Indeed: |
New files: * `nutrition_page.dart`: Preparatory nutrition page where data is loaded. * `nutrition_page_loaded.dart`: Actual nutrition page, with data already loaded. Impacted files: * `app_en.arb`: added 6 related labels * `app_fr.arb`: added 6 related labels * `knowledge_panels_builder.dart`: now the nutrition page button is systematic (but with a potentially different label/icon) * `new_product_page.dart`: minor refactoring * `product_cards_helper.dart`: minor refactoring * `smooth_app/pubspec.lock` * `smooth_ui_library/pubspec.lock` * `smooth_ui_library/example/pubspec.lock`
Impacted files: * `nutrition_page.dart`: refactored with `ProductQuery` * `nutrition_page_loaded.dart`: refactored with `ProductQuery` * `product_query.dart`: new method `getLocaleString`
New files: * `nutrition_page.dart`: Preparatory nutrition page where data is loaded. * `nutrition_page_loaded.dart`: Actual nutrition page, with data already loaded. Impacted files: * `app_en.arb`: added 6 related labels * `app_fr.arb`: added 6 related labels * `knowledge_panels_builder.dart`: now the nutrition page button is systematic (but with a potentially different label/icon) * `new_product_page.dart`: minor refactoring * `product_cards_helper.dart`: minor refactoring * `product_query.dart`: new method `getLocaleString` * `smooth_app/pubspec.lock` * `smooth_ui_library/pubspec.lock` * `smooth_ui_library/example/pubspec.lock`
@teolemon Still some questions/remarks:
|
|
Already mentioned by @M123-dev in the code review. My answer was:
|
perfect, sorry for my inattention 😅 |
Maybe that's possible on the server side, but that's not possible for the moment in off-dart: double? vitaminB12Serving
double? vitaminB12;
Unit? vitaminB12Unit; |
I'm afraid not. |
https://world.openfoodfacts.org/cgi/nutrients.pl does not have it, but https://static.openfoodfacts.org/data/taxonomies/nutrients.json does |
Impacted file: * `nutrition_page_loaded.dart` * explicit labels for units * removed "energy" line and computed "energy-kj" and "energy-kcal" accordingly * unit conversion (e.g. x 1000 for mg from g) * new small default nutrient unit repository
Maybe if we put it at the bottom of the page, like "Advanced: nutrition facts per portion"?
That would be similar to the |
I don't know how it is labeled on products, does every product has both Also can we generate the product data 5g sugar per 100g; portion=50g so 2,5g sugar per portion. If so it doesn't make sense to put it at the bottom |
@M123-dev Indeed, that could be a solution:
I mean, it's not because we have the possibility to enter that many data that it makes sense the ask the end-user to do so, especially:
|
… API (#910) Impacted files: * `app_en.arb`: added 3 labels * `app_fr.arb`: added 3 labels * `knowledge_panels_builder.dart`: added TODO comment * `nutrition_page_loaded.dart`: now validates and (almost) saves the form with the API
Who for
What
Tasks
Tasks
Mockup
Here's a first mockup, which hasn't been discussed yet
Code pointers
Why
Design doc
Part of
The text was updated successfully, but these errors were encountered: