Notification constructor

  1. @JsonSerializable(includeIfNull: false)
const Notification({
  1. @Default(appBskyNotificationListNotificationsNotification) @JsonKey(name: r'$type') String $type,
  2. @AtUriConverter() required AtUri uri,
  3. required String cid,
  4. @ProfileViewConverter() required ProfileView author,
  5. @UNotificationReasonConverter() required UNotificationReason reason,
  6. @AtUriConverter() AtUri? reasonSubject,
  7. required Map<String, dynamic> record,
  8. required bool isRead,
  9. required DateTime indexedAt,
  10. @LabelConverter() List<Label>? labels,
  11. @JsonKey(name: r'$unknown') Map<String, dynamic>? $unknown,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory Notification({
  /// The unique namespace for this lex object.
  ///
  /// `app.bsky.notification.listNotifications#notification`
  @Default(appBskyNotificationListNotificationsNotification)
  @JsonKey(name: r'$type')
  String $type,
  @AtUriConverter() required AtUri uri,
  required String cid,
  @ProfileViewConverter() required ProfileView author,

  /// Expected values are 'like', 'repost', 'follow', 'mention',
  /// 'reply', 'quote', and 'starterpack-joined'.
  @UNotificationReasonConverter() required UNotificationReason reason,
  @AtUriConverter() AtUri? reasonSubject,
  required Map<String, dynamic> record,
  required bool isRead,
  required DateTime indexedAt,
  @LabelConverter() List<Label>? labels,

  /// Contains unknown objects not defined in Lexicon.
  @JsonKey(name: r'$unknown') Map<String, dynamic>? $unknown,
}) = _Notification;