From e38fd3009c34fe2fc3cf403725d1eb02429882cb Mon Sep 17 00:00:00 2001 From: Merlin Dienst Date: Wed, 18 Dec 2024 21:42:27 +0100 Subject: [PATCH 1/2] reverted changes for onActivityItemLongPressed --- .../presentation/widgets/day_info_widget.dart | 30 +++---------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/lib/features/diary/presentation/widgets/day_info_widget.dart b/lib/features/diary/presentation/widgets/day_info_widget.dart index 20f0db1..05779c0 100644 --- a/lib/features/diary/presentation/widgets/day_info_widget.dart +++ b/lib/features/diary/presentation/widgets/day_info_widget.dart @@ -221,35 +221,13 @@ class DayInfoWidget extends StatelessWidget { } } - void showCopyOrDeleteActivityDialog( - BuildContext context, UserActivityEntity activityEntity) async { - final copyOrDelete = await showDialog( - context: context, builder: (context) => const CopyOrDeleteDialog()); - - if (copyOrDelete != null && !copyOrDelete) { - if (context.mounted) { - showDeleteActivityDialog(context, activityEntity); - } - } else if (copyOrDelete != null && copyOrDelete) { - onCopyActivity(activityEntity, null); - } - } - - void showDeleteActivityDialog( + void onActivityItemLongPressed( BuildContext context, UserActivityEntity activityEntity) async { - final shouldDeleteIntake = await showDialog( + final shouldDeleteActivity = await showDialog( context: context, builder: (context) => const DeleteDialog()); - if (shouldDeleteIntake != null) { - onDeleteActivity(activityEntity, trackedDayEntity); - } - } - void onActivityItemLongPressed( - BuildContext context, UserActivityEntity activityEntity) async { - if (DateUtils.isSameDay(selectedDay, DateTime.now())) { - showDeleteActivityDialog(context, activityEntity); - } else { - showCopyOrDeleteActivityDialog(context, activityEntity); + if (shouldDeleteActivity != null) { + onDeleteActivity(activityEntity, trackedDayEntity); } } } From 84c6b98e6dc8cd069137d6c185eb6d5869556d2c Mon Sep 17 00:00:00 2001 From: Merlin Dienst Date: Wed, 18 Dec 2024 21:49:09 +0100 Subject: [PATCH 2/2] fixed translation --- lib/generated/intl/messages_en.dart | 2 +- lib/generated/l10n.dart | 4 ++-- lib/l10n/intl_en.arb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 547be12..fc1c371 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -85,7 +85,7 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Choose Weight Goal"), "cmLabel": MessageLookupByLibrary.simpleMessage("cm"), "copyDialogTitle": MessageLookupByLibrary.simpleMessage( - "Which meal type di you want to copy to?"), + "Which meal type do you want to copy to?"), "copyOrDeleteTimeDialogContent": MessageLookupByLibrary.simpleMessage( "With \"Copy to today\" you can copy the meal to today. With \"Delete\" you can delete the meal."), "copyOrDeleteTimeDialogTitle": diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index dff2065..98bae11 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -921,10 +921,10 @@ class S { ); } - /// `Which meal type di you want to copy to?` + /// `Which meal type do you want to copy to?` String get copyDialogTitle { return Intl.message( - 'Which meal type di you want to copy to?', + 'Which meal type do you want to copy to?', name: 'copyDialogTitle', desc: '', args: [], diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index a6cb207..9772fcf 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -94,7 +94,7 @@ "deleteTimeDialogContent": "Do want to delete the selected item?", "itemDeletedSnackbar": "Item deleted", - "copyDialogTitle": "Which meal type di you want to copy to?", + "copyDialogTitle": "Which meal type do you want to copy to?", "copyOrDeleteTimeDialogTitle": "What do you want to do?", "copyOrDeleteTimeDialogContent": "With \"Copy to today\" you can copy the meal to today. With \"Delete\" you can delete the meal.",