fix: show dish calories in search and fix portion sheet layout crash
- DishSearchResult now carries calories_per_serving (backend entity + repo LEFT JOIN recipes / MIN / GROUP BY; Flutter model + fromJson) - _FoodTile.fromDish shows kcal/serving subtitle when available - _DishPortionSheet quick-select buttons: Row → Wrap to avoid BoxConstraints infinite-width crash inside DraggableScrollableSheet Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -61,10 +61,11 @@ type RecipeStep struct {
|
||||
|
||||
// DishSearchResult is a lightweight dish returned by the search endpoint.
|
||||
type DishSearchResult struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ImageURL *string `json:"image_url,omitempty"`
|
||||
AvgRating float64 `json:"avg_rating"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ImageURL *string `json:"image_url,omitempty"`
|
||||
AvgRating float64 `json:"avg_rating"`
|
||||
CaloriesPerServing *float64 `json:"calories_per_serving,omitempty"`
|
||||
}
|
||||
|
||||
// CreateRequest is the body used to create a new dish + recipe at once.
|
||||
|
||||
Reference in New Issue
Block a user