@@ -95,11 +95,11 @@ class FlNutritionalPlanGoalWidgetState extends State<FlNutritionalPlanGoalWidget
95
95
// if none goes over, 100% means fill all available space
96
96
final maxVal = [
97
97
1.0 ,
98
+ if (goals.energy != null && goals.energy! > 0 ) today.energy / goals.energy! ,
98
99
if (goals.protein != null && goals.protein! > 0 ) today.protein / goals.protein! ,
99
100
if (goals.carbohydrates != null && goals.carbohydrates! > 0 )
100
101
today.carbohydrates / goals.carbohydrates! ,
101
102
if (goals.fat != null && goals.fat! > 0 ) today.fat / goals.fat! ,
102
- if (goals.energy != null && goals.energy! > 0 ) today.energy / goals.energy! ,
103
103
if (goals.fiber != null && goals.fiber! > 0 ) today.fiber / goals.fiber! ,
104
104
].reduce (max);
105
105
@@ -112,6 +112,11 @@ class FlNutritionalPlanGoalWidgetState extends State<FlNutritionalPlanGoalWidget
112
112
return Column (
113
113
crossAxisAlignment: CrossAxisAlignment .start,
114
114
children: < Widget > [
115
+ Text (fmtMacro (AppLocalizations .of (context).energy, today.energy, goals.energy,
116
+ AppLocalizations .of (context).kcal)),
117
+ const SizedBox (height: 2 ),
118
+ _diyGauge (context, normWidth, goals.energy, today.energy),
119
+ const SizedBox (height: 8 ),
115
120
Text (fmtMacro (AppLocalizations .of (context).protein, today.protein, goals.protein,
116
121
AppLocalizations .of (context).g)),
117
122
const SizedBox (height: 2 ),
@@ -126,11 +131,6 @@ class FlNutritionalPlanGoalWidgetState extends State<FlNutritionalPlanGoalWidget
126
131
AppLocalizations .of (context).g)),
127
132
const SizedBox (height: 2 ),
128
133
_diyGauge (context, normWidth, goals.fat, today.fat),
129
- const SizedBox (height: 8 ),
130
- Text (fmtMacro (AppLocalizations .of (context).energy, today.energy, goals.energy,
131
- AppLocalizations .of (context).kcal)),
132
- const SizedBox (height: 2 ),
133
- _diyGauge (context, normWidth, goals.energy, today.energy),
134
134
// optionally display the advanced macro goals:
135
135
if (goals.fiber != null )
136
136
Column (crossAxisAlignment: CrossAxisAlignment .start, children: [
0 commit comments