This commit is contained in:
Dieter Plaetinck committed 2024-05-04 23:20:16 +02:00
1 parent 1ae3eafd72
commit 2347657dcd
2 files changed
+5

No files matched your search

@@ -118,6 +118,10 @@ class NutritionalPlan {
carbohydrates: goalCarbohydrates?.toDouble(),
);
}
// if there are no set goals and no defined meals, the goals are still undefined
if (meals.isEmpty) {
return NutritionalGoals();
}
// otherwise, add up all the nutritional values of the meals and use that as goals
final sumValues = meals.fold(NutritionalValues(), (a, b) => a + b.plannedNutritionalValues);
return NutritionalGoals(
+1
View File
@@ -625,6 +625,7 @@ class NothingFound extends StatelessWidget {
FormScreen.routeName,
arguments: FormScreenArguments(
_titleForm,
hasListView: true,
_form,
),
);