18
18
19
19
import 'package:flutter/material.dart' ;
20
20
import 'package:flutter_gen/gen_l10n/app_localizations.dart' ;
21
+ import 'package:flutter_svg_icons/flutter_svg_icons.dart' ;
21
22
import 'package:provider/provider.dart' ;
22
23
import 'package:wger/helpers/consts.dart' ;
23
24
import 'package:wger/models/nutrition/log.dart' ;
@@ -308,36 +309,20 @@ class MealHeader extends StatelessWidget {
308
309
contentPadding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 8 ),
309
310
title: Row (children: [
310
311
Expanded (
311
- child: (_meal.name != '' )
312
- ? Column (
313
- crossAxisAlignment: CrossAxisAlignment .start,
314
- children: [
315
- Text (
316
- _meal.name,
317
- style: Theme .of (context).textTheme.titleMedium,
318
- ),
319
- if (_meal.time != null )
320
- Text (
321
- _meal.time! .format (context),
322
- style: Theme .of (context).textTheme.headlineSmall,
323
- )
324
- ],
325
- )
326
- : Text (
327
- _meal.time != null ? _meal.time! .format (context) : '' ,
328
- style: Theme .of (context).textTheme.headlineSmall,
329
- ),
330
- ),
331
- if (_meal.isRealMeal)
332
- Text (
333
- AppLocalizations .of (context).log,
334
- style: Theme .of (context)
335
- .textTheme
336
- .labelLarge
337
- ? .copyWith (color: Theme .of (context).colorScheme.primary),
338
- ),
339
- const SizedBox (width: 26 ),
340
- const SizedBox (height: 40 , width: 1 , child: VerticalDivider ()),
312
+ child: Column (
313
+ crossAxisAlignment: CrossAxisAlignment .start,
314
+ children: [
315
+ Text (
316
+ ((_meal.time != null ) ? '${_meal .time !.format (context )} ' : '' ) + _meal.name,
317
+ style: Theme .of (context).textTheme.titleMedium,
318
+ ),
319
+ if (_meal.isRealMeal)
320
+ Text (
321
+ getShortNutritionValues (_meal.plannedNutritionalValues, context),
322
+ style: Theme .of (context).textTheme.titleSmall,
323
+ ),
324
+ ],
325
+ )),
341
326
]),
342
327
trailing: Row (
343
328
mainAxisSize: MainAxisSize .min,
@@ -363,7 +348,9 @@ class MealHeader extends StatelessWidget {
363
348
onPressed: () {
364
349
_toggleEditing ();
365
350
},
366
- )
351
+ ),
352
+ if (_meal.isRealMeal) const SizedBox (width: 5 ),
353
+ if (_meal.isRealMeal) const SvgIcon (icon: SvgIconData ('assets/icons/meal-diary.svg' )),
367
354
],
368
355
),
369
356
onTap: _meal.isRealMeal
0 commit comments