diff --git a/lib/alarm/logic/alarm_reminder_notifications.dart b/lib/alarm/logic/alarm_reminder_notifications.dart index 7989a165..9ae05cd0 100644 --- a/lib/alarm/logic/alarm_reminder_notifications.dart +++ b/lib/alarm/logic/alarm_reminder_notifications.dart @@ -15,7 +15,7 @@ Future cancelAlarmReminderNotification(int id) async { } Future createAlarmReminderNotification( - int id, DateTime time, bool tasksRequired) async { + int id, String label, DateTime time, bool tasksRequired) async { await cancelAlarmReminderNotification(id); bool shouldShow = appSettings .getGroup("Alarm") @@ -47,7 +47,7 @@ Future createAlarmReminderNotification( content: NotificationContent( id: id, channelKey: reminderNotificationChannelKey, - title: "Upcoming alarm", + title: "Upcoming alarm${label.isEmpty ? "" : ": $label"}", body: time.toTimeOfDay().formatToString(timeFormatString), category: NotificationCategory.Reminder, payload: { @@ -91,7 +91,7 @@ Future createSnoozeNotification(int id, DateTime time) async { content: NotificationContent( id: id, channelKey: reminderNotificationChannelKey, - title: "Snoozed alarm", + title: "Snoozed alarm${alarm.label.isEmpty ? "" : ": ${alarm.label}"}", body: time.toTimeOfDay().formatToString(timeFormatString), // wakeUpScreen: true, category: NotificationCategory.Reminder, diff --git a/lib/alarm/screens/alarm_notification_screen.dart b/lib/alarm/screens/alarm_notification_screen.dart index 3e3e3030..0d616f7e 100644 --- a/lib/alarm/screens/alarm_notification_screen.dart +++ b/lib/alarm/screens/alarm_notification_screen.dart @@ -121,6 +121,12 @@ class _AlarmNotificationScreenState extends State { child: Column( children: [ const Spacer(), + if (alarm.label.isNotEmpty) + Text( + alarm.label, + style: Theme.of(context).textTheme.titleMedium, + ), + const SizedBox(height: 8), const Clock( // dateTime: Date, horizontalAlignment: ElementAlignment.center, diff --git a/lib/alarm/types/alarm.dart b/lib/alarm/types/alarm.dart index cda6e805..66067aa7 100644 --- a/lib/alarm/types/alarm.dart +++ b/lib/alarm/types/alarm.dart @@ -262,7 +262,7 @@ class Alarm extends CustomizableListItem { currentScheduleDateTime != null && !shouldSkipNextAlarm) { await createAlarmReminderNotification( - id, currentScheduleDateTime!, tasks.isNotEmpty); + id, label, currentScheduleDateTime!, tasks.isNotEmpty); } else { for (var schedule in _schedules) { cancelAlarmReminderNotification(schedule.currentAlarmRunnerId);