-
-
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
feat: #511 - displays both 100g and serving, saves the form with the API #910
feat: #511 - displays both 100g and serving, saves the form with the API #910
Conversation
…orm with the API 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 displays both 100g/serving data at the same time * now validates and save the form with the API
… no API call Impacted file: * `nutrition_page_loaded.dart`
@teolemon What I've just committed matches to your latest remarks:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
bool _perServing = false; | ||
bool _unspecified = false; | ||
bool _unspecified = false; // TODO(monsieurtanuki): fetch that data from API? | ||
bool _servingOr100g = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is maybe confusing, which value is serving and which is 100g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admit that it's not 100% intuitive, but once you've understood the logic you're OK.
I wouldn't use enum
s for that. Then what? bool _isServing;
?
Anyway the story is not over, I'll have numerous opportunities to fix that bool
(or replace it altogether).
Thanks for the code review @M123-dev!
Please: if you could also have a look at openfoodfacts/openfoodfacts-dart#362 I could go further (and stop querying the internet systematically).
I strongly suggest anyone willing to test it live to switch to TEST env.
Impacted files:
app_en.arb
: added 3 labelsapp_fr.arb
: added 3 labelsknowledge_panels_builder.dart
: added TODO commentnutrition_page_loaded.dart
: