Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,25 @@
"@toAddMealsToThePlanGoToNutritionalPlanDetails": {
"description": "Message shown to guide users to the nutritional plan details page to add meals"
},
"planDateRange": "from {startDate} to {endDate}",
"@planDateRange": {
"description": "Label for the start and end date range of a plan",
"placeholders": {
"startDate": { "type": "String" },
"endDate": { "type": "String" }
}
},
"planStartDate": "from {startDate}",
"@planStartDate": {
"description": "Label for the start date of a plan",
"placeholders": {
"startDate": { "type": "String" }
}
},
"otherLogs": "Other logs",
"@otherLogs": {
"description": "Other unassigned logs. Label for the pseudo-meal section that groups all nutritional diary entries not assigned to a specific meal"
},
"goalEnergy": "Energy goal",
"goalProtein": "Protein goal",
"goalCarbohydrates": "Carbohydrates goal",
Expand Down Expand Up @@ -675,6 +694,10 @@
"fiber": "Fibers",
"sodium": "Sodium",
"@sodium": {},
"carbohydratesSugar": "Sugar (Carbohydrates)",
"@carbohydratesSugar": {
"description": "Label for the carbohydrates sugar"
},
"amount": "Amount",
"@amount": {
"description": "The amount (e.g. in grams) of an ingredient in a meal"
Expand Down
5 changes: 5 additions & 0 deletions lib/providers/nutrition_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class NutritionState {
/// Returns the plan with the given [id], or `null` if it isn't (yet) in the
/// streamed snapshot
NutritionalPlan? findByIdOrNull(String? id) => plans.firstWhereOrNull((plan) => plan.id == id);

List<MealItem>? recentMealItemsInPlan(String? planId) {
final nutriPlan = plans.firstWhereOrNull((plan) => plan.id == planId);
return nutriPlan?.dedupMealItems;
}
}

@Riverpod(keepAlive: true)
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/log_meal_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class _LogMealScreenState extends ConsumerState<LogMealScreen> {
children: [
const DiaryheaderTile(),
...meal.mealItems.map(
(item) => MealItemEditableFullTile(item, viewMode.withAllDetails, false),
(item) => MealItemEditableFullTile(item, ViewMode.withAllDetails, false),
),
const SizedBox(height: 32),
Text(
Expand Down
1 change: 0 additions & 1 deletion lib/screens/log_meals_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class _LogMealsScreenState extends State<LogMealsScreen> {
itemCount: nutritionalPlan.meals.length,
itemBuilder: (context, index) => MealWidget(
nutritionalPlan.meals[index],
nutritionalPlan.dedupMealItems,
true,
true,
),
Expand Down
Loading