@@ -35,9 +35,11 @@ class NutritionalPlanDetailWidget extends StatelessWidget {
35
35
Widget build (BuildContext context) {
36
36
final nutritionalGoals = _nutritionalPlan.nutritionalGoals;
37
37
final lastWeightEntry =
38
- Provider .of <BodyWeightProvider >(context, listen: false ).getNewestEntry ();
39
- final nutritionalGoalsGperKg =
40
- lastWeightEntry != null ? nutritionalGoals / lastWeightEntry.weight.toDouble () : null ;
38
+ Provider .of <BodyWeightProvider >(context, listen: false )
39
+ .getNewestEntry ();
40
+ final nutritionalGoalsGperKg = lastWeightEntry != null
41
+ ? nutritionalGoals / lastWeightEntry.weight.toDouble ()
42
+ : null ;
41
43
42
44
return SliverList (
43
45
delegate: SliverChildListDelegate (
@@ -51,6 +53,49 @@ class NutritionalPlanDetailWidget extends StatelessWidget {
51
53
),
52
54
),
53
55
),
56
+ Padding (
57
+ padding:
58
+ const EdgeInsets .symmetric (horizontal: 16.0 , vertical: 8.0 ),
59
+ child: Column (
60
+ crossAxisAlignment: CrossAxisAlignment .start,
61
+ children: [
62
+ Row (
63
+ children: [
64
+ Text (
65
+ '${AppLocalizations .of (context ).start }: ' ,
66
+ style: Theme .of (context)
67
+ .textTheme
68
+ .titleMedium!
69
+ .copyWith (fontWeight: FontWeight .bold),
70
+ ),
71
+ Text (
72
+ '${_nutritionalPlan .startDate .day .toString ().padLeft (2 , '0' )}.${_nutritionalPlan .startDate .month .toString ().padLeft (2 , '0' )}.${_nutritionalPlan .startDate .year }' ,
73
+ style: Theme .of (context).textTheme.titleMedium,
74
+ ),
75
+ ],
76
+ ),
77
+ if (_nutritionalPlan.endDate != null )
78
+ Padding (
79
+ padding: const EdgeInsets .only (top: 4.0 ),
80
+ child: Row (
81
+ children: [
82
+ Text (
83
+ '${AppLocalizations .of (context ).endDate }: ' ,
84
+ style: Theme .of (context)
85
+ .textTheme
86
+ .titleMedium!
87
+ .copyWith (fontWeight: FontWeight .bold),
88
+ ),
89
+ Text (
90
+ '${_nutritionalPlan .endDate !.day .toString ().padLeft (2 , '0' )}.${_nutritionalPlan .endDate !.month .toString ().padLeft (2 , '0' )}.${_nutritionalPlan .endDate !.year }' ,
91
+ style: Theme .of (context).textTheme.titleMedium,
92
+ ),
93
+ ],
94
+ ),
95
+ ),
96
+ ],
97
+ ),
98
+ ),
54
99
const SizedBox (height: 10 ),
55
100
..._nutritionalPlan.meals.map ((meal) => MealWidget (
56
101
meal,
@@ -68,7 +113,8 @@ class NutritionalPlanDetailWidget extends StatelessWidget {
68
113
Container (
69
114
padding: const EdgeInsets .all (15 ),
70
115
height: 220 ,
71
- child: FlNutritionalPlanPieChartWidget (nutritionalGoals.toValues ()),
116
+ child:
117
+ FlNutritionalPlanPieChartWidget (nutritionalGoals.toValues ()),
72
118
),
73
119
Padding (
74
120
padding: const EdgeInsets .symmetric (horizontal: 10 ),
0 commit comments