Notification constructor

  1. @JsonSerializable(includeIfNull: false)
const Notification({
  1. required String id,
  2. required NotificationType type,
  3. required DateTime createdAt,
  4. required Account account,
  5. Status? status,
  6. Report? report,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory Notification({
  /// The id of the notification in the database.
  required String id,

  /// The type of event that resulted in the notification.
  required NotificationType type,

  /// The timestamp of the notification.
  required DateTime createdAt,

  /// The account that performed the action that generated the notification.
  required Account account,

  /// Status that was the object of the notification. Attached when type of
  /// the notification is favourite, reblog, status, mention, poll,
  /// or update.
  Status? status,

  // Report that was the object of the notification.
  // Attached when type of the notification is admin.report.
  Report? report,
}) = _Notification;