Skip to content
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

Reintroduce the portion calculator (client side ? server side ?) #2354

Closed
Tracked by #2318
teolemon opened this issue Jun 21, 2022 · 5 comments · Fixed by #3027
Closed
Tracked by #2318

Reintroduce the portion calculator (client side ? server side ?) #2354

teolemon opened this issue Jun 21, 2022 · 5 comments · Fixed by #3027

Comments

@teolemon
Copy link
Member

teolemon commented Jun 21, 2022

What

  • Reintroduce the portion calculator (client side ? server side ?)
  • Based on a user complaint

Mockups

image
image

Part of

@teolemon
Copy link
Member Author

image

@M123-dev
Copy link
Member

17 likes thats a lot

@monsieurtanuki
Copy link
Contributor

The good news is that is very easy to implement, it's just a cross-multiplication on the client side.

@monsieurtanuki monsieurtanuki self-assigned this Sep 16, 2022
@monsieurtanuki
Copy link
Contributor

So far this is what I managed to code. @teolemon Any strong disapproval about the UI or I can push like that?

new widgets (bottom) click on "compute"
Capture d’écran 2022-09-16 à 15 02 17 Capture d’écran 2022-09-16 à 15 02 34

@teolemon
Copy link
Member Author

woooh nice, some little tweaks:

  • "Nutrition facts for $quantity"
  • replace "g" by "g or L"
  • Adding a title and icon with the same structure as the table, with "Nutrition per portion"
  • https://fonts.google.com/icons?icon.query=scale
  • Add helper text:
    • "Compute nutrition facts for a specific quantity"

monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Sep 16, 2022
…rient page

New file:
* `portion_calculator.dart`: Displays a portion size selector and a "compute!" button; results as dialog.

Impacted files:
* `app_en.arb`: added 3 related labels
* `app_fr.arb`: added 3 related labels
* `knowledge_panel_element_card.dart`: minor refactoring
* `knowledge_panel_table_card.dart`: added a `PortionCalculator` when relevant
* `nutrition_container.dart`: minor refactoring
monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Sep 17, 2022
New file:
* `portion_helper.dart`: Helper class that computes the values of each nutrient for a portion.

Impacted files:
* `nutrition_container.dart`: minor refactoring about making some fields and methods public.
* `portion_calculator.dart`: now uses new class `PortionHelper`
monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Sep 17, 2022
monsieurtanuki added a commit that referenced this issue Sep 17, 2022
…3027)

New files:
* `portion_calculator.dart`: Displays a portion size selector and a "compute!" button; results as dialog.
* `portion_helper.dart`: Helper class that computes the values of each nutrient for a portion.

Impacted files:
* `app_en.arb`: added 3 related labels
* `app_fr.arb`: added 3 related labels
* `knowledge_panel_element_card.dart`: minor refactoring
* `knowledge_panel_table_card.dart`: added a `PortionCalculator` when relevant
* `nutrition_container.dart`: minor refactoring
Repository owner moved this from To discuss and validate to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment