Notification.fromMap constructor

Notification.fromMap(
  1. Map snapshot,
  2. String id
)

Constructs a Notification instance from a map.

snapshot is a map containing the notification data. id is the unique identifier of the notification.

Implementation

Notification.fromMap(Map snapshot, String id)
    : documentId = snapshot['documentId'] ?? '',
      module = snapshot['module'] ?? '',
      type = snapshot['type'] ?? '',
      title = snapshot['title'] ?? '',
      message = snapshot['body'] ?? '',
      read = snapshot['isRead'] ?? false,
      delete = snapshot['delete'] ?? false,
      imageUrl = snapshot['imageUrl'] ?? '',
      link = snapshot['link'] ?? '',
      createdOn = snapshot['createdAt'].toDate(),
      createdBy = snapshot['createdBy'] ?? '';