ActivityModel constructor

const ActivityModel(
  1. {required String id,
  2. String? title,
  3. @JsonKey(fromJson: activityDateFromJson, toJson: activityDateToJson) required (DateTime?, DateTime?) date,
  4. @JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson) DateTime? postDate,
  5. @JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson) DateTime? lastEdited,
  6. String? posterId,
  7. @Default("") String location,
  8. @Default("") String description,
  9. @Default("") String descriptionPlain,
  10. String? bannerDownloadURL,
  11. String? blurhash,
  12. String? linkedURL,
  13. @Default(ActivityCategory.leiden) ActivityCategory? category,
  14. @Default(true) bool sendNotification,
  15. @Default(true) bool createPhotoAlbum,
  16. String? photosFolderIdPublic,
  17. @JsonKey(fromJson: colorFromJson, toJson: colorToJson) @Default(Color(0xff006600)) Color color,
  18. @Default(false) bool isEdited}
)

Implementation

const factory ActivityModel({
  /// The id of the activity
  required String id,

  /// The title of the activity
  String? title,

  /// The start and end date of the activity
  ///
  /// The start date is the first element of the tuple and the end date is the
  /// second element.
  @JsonKey(fromJson: activityDateFromJson, toJson: activityDateToJson)
  required (DateTime? startDate, DateTime? endDate) date,

  /// The date and time the activity was posted
  @JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson)
  DateTime? postDate,

  /// The date and time the activity was last edited
  @JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson)
  DateTime? lastEdited,

  /// The id of the user who posted the activity
  String? posterId,

  /// The location of the activity
  @Default("") String location,

  /// The description of the activity in Quill format
  @Default("") String description,

  /// The description of the activity in plain text
  @Default("") String descriptionPlain,

  /// The URL of the banner image of the activity
  String? bannerDownloadURL,

  /// The blurhash of the banner image of the activity
  String? blurhash,

  /// The URL of a linked page of the activity.
  ///
  /// This is commonly used for sign up forms or links to external pages.
  /// It is accessed by clicking the 'Participate' button on the activity page.
  String? linkedURL,

  /// The category of the activity (Leiden or Europe)
  @Default(ActivityCategory.leiden) ActivityCategory? category,

  /// Whether to send a notification when the activity is posted
  @Default(true) bool sendNotification,

  /// Whether to create a photo album for the activity
  @Default(true) bool createPhotoAlbum,

  /// The ID of the public Google Photos folder for the activity.
  ///
  /// This field is populated by a Cloud Function when the activity is posted.
  String? photosFolderIdPublic,

  /// The color of the activity
  @JsonKey(fromJson: colorFromJson, toJson: colorToJson)
  @Default(Color(0xff006600))
  Color color,

  /// Whether the activity has been edited
  @Default(false) bool isEdited,
}) = _ActivityModel;