InboxNotification.fromMap constructor

InboxNotification.fromMap(
  1. Map json
)

Implementation

factory InboxNotification.fromMap(Map json) {
  final path = {
    'activity': 'evenement',
    'post': 'post',
    'announcement': 'admin',
    'admin': 'admin',
    null: null,
  }[json["path"]];

  return InboxNotification(
    date: (json["timestamp"] as Timestamp).toDate(),
    title: json["title"] as String,
    subtitle: json["subtitle"] as String?,
    path: path,
    id: json["id"] as String?,
  );
}