Skip to content

Commit d5fa2b9

Browse files
committed
fiber rename fixes
1 parent 67cd227 commit d5fa2b9

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

lib/models/nutrition/nutritional_plan.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class NutritionalPlan {
5656
@JsonKey(required: true, name: 'goal_fat')
5757
late num? goalFat;
5858

59-
@JsonKey(required: true, name: 'goal_fibers')
60-
late num? goalFibers;
59+
@JsonKey(required: true, name: 'goal_fiber')
60+
late num? goalFiber;
6161

6262
@JsonKey(includeFromJson: false, includeToJson: false, defaultValue: [])
6363
List<Meal> meals = [];
@@ -74,7 +74,7 @@ class NutritionalPlan {
7474
this.goalProtein,
7575
this.goalCarbohydrates,
7676
this.goalFat,
77-
this.goalFibers,
77+
this.goalFiber,
7878
List<Meal>? meals,
7979
List<Log>? diaryEntries,
8080
}) {
@@ -89,7 +89,7 @@ class NutritionalPlan {
8989
goalEnergy = null;
9090
goalProtein = null;
9191
goalCarbohydrates = null;
92-
goalFibers = null;
92+
goalFiber = null;
9393
goalFat = null;
9494
}
9595

@@ -110,7 +110,7 @@ class NutritionalPlan {
110110
}
111111

112112
bool get hasAnyAdvancedGoals {
113-
return goalFibers != null;
113+
return goalFiber != null;
114114
}
115115

116116
/// Calculations
@@ -126,7 +126,7 @@ class NutritionalPlan {
126126
fat: goalFat?.toDouble(),
127127
protein: goalProtein?.toDouble(),
128128
carbohydrates: goalCarbohydrates?.toDouble(),
129-
fiber: goalFibers?.toDouble(),
129+
fiber: goalFiber?.toDouble(),
130130
);
131131
}
132132
// if there are no set goals and no defined meals, the goals are still undefined

lib/models/nutrition/nutritional_plan.g.dart

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/widgets/nutrition/charts.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ class NutritionalDiaryChartWidgetFlState extends State<NutritionalDiaryChartWidg
401401
barchartGroup(3, barsSpace, barsWidth, 'fat'),
402402
barchartGroup(4, barsSpace, barsWidth, 'fatSaturated'),
403403
if (widget._nutritionalPlan.nutritionalGoals.fiber != null)
404-
barchartGroup(5, barsSpace, barsWidth, 'fibers'),
404+
barchartGroup(5, barsSpace, barsWidth, 'fiber'),
405405
],
406406
),
407407
),

lib/widgets/nutrition/forms.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,9 @@ class _PlanFormState extends State<PlanForm> {
512512
widget._plan.goalProtein = null;
513513
widget._plan.goalCarbohydrates = null;
514514
widget._plan.goalFat = null;
515-
widget._plan.goalFibers = null;
515+
widget._plan.goalFiber = null;
516516
case GoalType.basic:
517-
widget._plan.goalFibers = null;
517+
widget._plan.goalFiber = null;
518518
break;
519519
default:
520520
break;
@@ -562,11 +562,11 @@ class _PlanFormState extends State<PlanForm> {
562562

563563
if (_goalType == GoalType.advanced)
564564
GoalMacros(
565-
val: widget._plan.goalFibers?.toString(),
565+
val: widget._plan.goalFiber?.toString(),
566566
label: AppLocalizations.of(context).goalFiber,
567567
suffix: AppLocalizations.of(context).g,
568-
onSave: (double value) => widget._plan.goalFibers = value,
569-
key: const Key('field-goal-fibers'),
568+
onSave: (double value) => widget._plan.goalFiber = value,
569+
key: const Key('field-goal-fiber'),
570570
),
571571
ElevatedButton(
572572
key: const Key(SUBMIT_BUTTON_KEY_NAME),

test/fixtures/nutrition/nutritional_plan_detail_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"goal_protein": null,
88
"goal_carbohydrates": null,
99
"goal_fat": null,
10-
"goal_fibers": null,
10+
"goal_fiber": null,
1111
"language": 1
1212
}

test/fixtures/nutrition/nutritional_plan_info_detail_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"goal_protein": null,
1212
"goal_carbohydrates": null,
1313
"goal_fat": null,
14-
"goal_fibers": null,
14+
"goal_fiber": null,
1515
"description": "",
1616
"get_nutritional_values": {
1717
"total": {

0 commit comments

Comments
 (0)