feat: Allow attaching arbitrary data to the notification

This commit is contained in:
2023-07-29 15:32:33 +02:00
parent 6da35cd0ba
commit c7ee2b6c6e
6 changed files with 84 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ class NotificationMessage {
}
class MessagingNotification {
const MessagingNotification(this.title, this.id, this.jid, this.messages, this.channelId);
const MessagingNotification(this.title, this.id, this.jid, this.messages, this.channelId, this.extra);
/// The title of the conversation.
final String title;
@@ -70,6 +70,9 @@ class MessagingNotification {
/// Messages to show.
final List<NotificationMessage?> messages;
/// Additional data to include.
final Map<String?, String?>? extra;
}
enum NotificationIcon {
@@ -120,6 +123,9 @@ class NotificationEvent {
/// - type == NotificationType.reply: The reply message text.
/// Otherwise: undefined.
final String? payload;
/// Extra data. Only set when type == NotificationType.reply.
final Map<String?, String?>? extra;
}
class NotificationI18nData {