@@ -146,14 +146,6 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
146
146
return out;
147
147
}
148
148
149
- Widget getTrailing () {
150
- if (! _hasContent) {
151
- return const Text ('' );
152
- }
153
-
154
- return _showDetail ? const Icon (Icons .expand_less) : const Icon (Icons .expand_more);
155
- }
156
-
157
149
@override
158
150
Widget build (BuildContext context) {
159
151
return Card (
@@ -174,24 +166,34 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
174
166
Icons .restaurant,
175
167
color: Theme .of (context).textTheme.headlineSmall! .color,
176
168
),
177
- trailing: getTrailing (),
169
+ trailing: _hasContent
170
+ ? Tooltip (
171
+ message: AppLocalizations .of (context).toggleDetails,
172
+ child: _showDetail
173
+ ? const Icon (
174
+ Icons .info,
175
+ )
176
+ : const Icon (Icons .info_outline))
177
+ : const SizedBox (),
178
178
onTap: () {
179
179
setState (() {
180
180
_showDetail = ! _showDetail;
181
181
});
182
182
},
183
183
),
184
184
if (_hasContent)
185
- Column (
186
- children: [
187
- ...getContent (),
188
- Container (
189
- padding: const EdgeInsets .all (15 ),
190
- height: 180 ,
191
- child: FlNutritionalPlanPieChartWidget (_plan! .nutritionalValues),
192
- )
193
- ],
194
- )
185
+ Padding (
186
+ padding: const EdgeInsets .symmetric (horizontal: 10 ),
187
+ child: Column (
188
+ children: [
189
+ ...getContent (),
190
+ Container (
191
+ padding: const EdgeInsets .symmetric (horizontal: 5 , vertical: 15 ),
192
+ height: 180 ,
193
+ child: FlNutritionalPlanPieChartWidget (_plan! .nutritionalValues),
194
+ )
195
+ ],
196
+ ))
195
197
else
196
198
NothingFound (
197
199
AppLocalizations .of (context).noNutritionalPlans,
@@ -441,14 +443,6 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
441
443
_hasContent = _workoutPlan != null ;
442
444
}
443
445
444
- Widget getTrailing () {
445
- if (! _hasContent) {
446
- return const Text ('' );
447
- }
448
-
449
- return _showDetail ? const Icon (Icons .expand_less) : const Icon (Icons .expand_more);
450
- }
451
-
452
446
List <Widget > getContent () {
453
447
final List <Widget > out = [];
454
448
@@ -540,16 +534,24 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
540
534
Icons .fitness_center,
541
535
color: Theme .of (context).textTheme.headlineSmall! .color,
542
536
),
543
- trailing: getTrailing (),
537
+ trailing: _hasContent
538
+ ? Tooltip (
539
+ message: AppLocalizations .of (context).toggleDetails,
540
+ child: _showDetail
541
+ ? const Icon (
542
+ Icons .info,
543
+ )
544
+ : const Icon (Icons .info_outline))
545
+ : const SizedBox (),
544
546
onTap: () {
545
547
setState (() {
546
548
_showDetail = ! _showDetail;
547
549
});
548
550
},
549
551
),
550
552
if (_hasContent)
551
- Container (
552
- padding: const EdgeInsets .only (left : 10 ),
553
+ Padding (
554
+ padding: const EdgeInsets .symmetric (horizontal : 10 ),
553
555
child: Column (
554
556
children: [
555
557
...getContent (),
0 commit comments