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

User Preference for 'per 100g' vs 'per serving' toggle #3615

Open
zanovis opened this issue Jan 23, 2023 · 7 comments
Open

User Preference for 'per 100g' vs 'per serving' toggle #3615

zanovis opened this issue Jan 23, 2023 · 7 comments

Comments

@zanovis
Copy link

zanovis commented Jan 23, 2023

Problem

In the US, nutrition facts are only provided 'per serving' which could be any number of grams/ounces/etc. It would be ideal to make a user preference for this, as I imagine it is largely region-dependent.

Proposed solution

Store this toggle as a shared_preference

Part of

@zanovis zanovis added the ✨ enhancement New feature or request label Jan 23, 2023
@monsieurtanuki
Copy link
Contributor

The 100g/serving switch value is either the one from the downloaded product, or with a default of 100g (for new products), cf. nutrition_container.dart:

    _initialPerSize = perSize =
        PerSize.fromOffTag(product.nutrimentDataPer) ?? PerSize.oneHundredGrams;

What you want is a new preference in order to change the default value for new products to "per serving", so that each time you input a new product, "per serving" would be selected, right?
I don't know if we should make that default value initially computed from the country, too.

@monsieurtanuki
Copy link
Contributor

@BhuvanAde As suggested, please add a user preference about the default "per 100g / per serving" and use it as default value in the nutrition fact page.

@ooprathamm
Copy link

@monsieurtanuki I would like to work on this

to select the default value, should I add the toggle inside App Settings -> Products

@BhuvanAde
Copy link
Contributor

@ooprathamm I'm already working on this issue.

@BhuvanAde
Copy link
Contributor

@monsieurtanuki I'm so sorry forgot about this. I wasn't clear with the issue I see a similar type of issue #3617 are we moving forward with this issue?
Please confirm. And please let me know if there are any open issues.

@monsieurtanuki
Copy link
Contributor

@BhuvanAde Please add the default switch 100g/serving in the preferences (default 100g), and use it as default in the nutrition page.

@monsieurtanuki
Copy link
Contributor

@BhuvanAde Still working on it, or may we reassign this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 💬 To discuss and validate
Development

No branches or pull requests

5 participants