createReminderNotification method
Creates a reminder notification template.
Implementation
NotificationPayload createReminderNotification({
required String id,
required String title,
required String body,
DateTime? scheduledDateTime,
RepeatInterval? repeatInterval,
Map<String, dynamic>? data,
}) {
return NotificationPayload(
id: id,
title: title,
body: body,
data: <String, dynamic>{
'type': 'reminder',
'scheduledTime': scheduledDateTime?.toIso8601String(),
...?data,
},
isScheduled: scheduledDateTime != null,
scheduledDateTime: scheduledDateTime,
repeatInterval: repeatInterval,
importance: NotificationImportance.high,
priority: NotificationPriority.high,
category: 'reminder',
actions: const <NotificationAction>[
NotificationAction(id: 'snooze', title: 'Snooze'),
NotificationAction(id: 'complete', title: 'Complete'),
],
);
}