Add vegan and vegetarian fields and filters to the ingredient#1124
Open
rolandgeider wants to merge 4 commits intomasterfrom
Open
Add vegan and vegetarian fields and filters to the ingredient#1124rolandgeider wants to merge 4 commits intomasterfrom
rolandgeider wants to merge 4 commits intomasterfrom
Conversation
mubashardev
approved these changes
Feb 27, 2026
There was a problem hiding this comment.
Overall
Great PR! The implementation for filtering by dietary preferences is clean, localization is handled well, and the added test coverage in ingredient_typeahead_test.dart is excellent.
I've left a few minor non-blocking suggestions below for your consideration. Nice work!
Minor Suggestions (Non-blocking):
- State Management Clarity (
lib/widgets/nutrition/widgets.dart):
In theStatefulBuilder'sonChangedcallbacks, thesetStateshadowing is functional but could be slightly clearer for readability:
onChanged: (val) {
this.setState(() {
_isVegan = val; // Clearly updates the parent Widget state
});
setState(() {}); // Signals StatefulBuilder dialog to rebuild its UI
},- Query Parameters (
lib/providers/nutrition.dart):
Currently passing'True'(capitalized) for the query parameter. While Django REST Framework typically handles this fine, standard web serialization generally favors lowercase ('true') for booleans across the wire.
Member
Author
|
yes you are right, I've clean up a bit the code |
mubashardev
approved these changes
Feb 27, 2026
While this has technically nothing to do with the vegan flags, we can refactor the language handling while we're at it. This should make the behaviour more transparent to the user and could be expanded in the future if needed (manually selecting other languages, etc.).
35815c3 to
51b6566
Compare
# Conflicts: # lib/l10n/app_de.arb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue(s)
Flutter part of wger-project/wger#2217