Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion lib/features/home/presentation/widgets/intake_vertical_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ class _IntakeVerticalListState extends State<IntakeVerticalList> {
.fold(0, (previousValue, element) => previousValue + element.totalKcal);
}

double get totalCarbsGram {
return widget.intakeList
.fold(0, (previousValue, element) => previousValue + element.totalCarbsGram);
}

double get totalFatsGram {
return widget.intakeList
.fold(0, (previousValue, element) => previousValue + element.totalFatsGram);
}

double get totalProteinsGram {
return widget.intakeList
.fold(0, (previousValue, element) => previousValue + element.totalProteinsGram);
}

@override
Widget build(BuildContext context) {
return Column(
Expand All @@ -90,12 +105,14 @@ class _IntakeVerticalListState extends State<IntakeVerticalList> {
const Spacer(),
if (totalKcal > 0) ...[
Text(
'${totalKcal.toInt()} ${S.of(context).kcalLabel}',
'${totalKcal.toInt()} ${S.of(context).kcalLabel}\n'
'${totalCarbsGram.toInt()} ${S.of(context).carbsLabelShort} ${totalFatsGram.toInt()} ${S.of(context).fatLabelShort} ${totalProteinsGram.toInt()} ${S.of(context).proteinLabelShort}',
style: Theme.of(context).textTheme.titleSmall?.copyWith(
color: Theme.of(context)
.colorScheme
.onSurface
.withValues(alpha: 0.7)),
textAlign: TextAlign.center,
),
PopupMenuButton<VerticalListPopupMenuSelections>(
onSelected:
Expand Down
13 changes: 9 additions & 4 deletions lib/generated/intl/messages_all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ MessageLookupByLibrary? _findExact(String localeName) {
/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) {
var availableLocale = Intl.verifiedLocale(
localeName, (locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
localeName,
(locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null,
);
if (availableLocale == null) {
return new SynchronousFuture(false);
}
Expand All @@ -64,8 +66,11 @@ bool _messagesExistFor(String locale) {
}

MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale =
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
var actualLocale = Intl.verifiedLocale(
locale,
_messagesExistFor,
onFailure: (_) => null,
);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}
1,434 changes: 788 additions & 646 deletions lib/generated/intl/messages_de.dart

Large diffs are not rendered by default.

1,409 changes: 771 additions & 638 deletions lib/generated/intl/messages_en.dart

Large diffs are not rendered by default.

1,400 changes: 770 additions & 630 deletions lib/generated/intl/messages_tr.dart

Large diffs are not rendered by default.

Loading