Notification constructor

  1. @JsonSerializable.new(includeIfNull: false)
const Notification({
  1. @Default.new('app.bsky.notification.listNotifications#notification') String $type,
  2. @AtUriConverter.new() required AtUri uri,
  3. required String cid,
  4. @ProfileViewConverter() required ProfileView author,
  5. @NotificationReasonConverter() required NotificationReason reason,
  6. @AtUriConverter.new() AtUri? reasonSubject,
  7. required Map<String, dynamic> record,
  8. required bool isRead,
  9. required DateTime indexedAt,
  10. @LabelConverter() List<Label>? labels,
  11. Map<String, dynamic>? $unknown,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory Notification({
  @Default('app.bsky.notification.listNotifications#notification')
  String $type,
  @AtUriConverter() required AtUri uri,
  required String cid,
  @ProfileViewConverter() required ProfileView author,

  /// The reason why this notification was delivered - e.g. your post was liked, or you received a new follower.
  @NotificationReasonConverter() required NotificationReason reason,
  @AtUriConverter() AtUri? reasonSubject,
  required Map<String, dynamic> record,
  required bool isRead,
  required DateTime indexedAt,
  @LabelConverter() List<Label>? labels,

  Map<String, dynamic>? $unknown,
}) = _Notification;