ActivityModel constructor
const
ActivityModel(- {required String id,
- String? title,
- @JsonKey(fromJson: activityDateFromJson, toJson: activityDateToJson) required (DateTime?, DateTime?) date,
- @JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson) DateTime? postDate,
- @JsonKey(fromJson: dateTimeFromJson, toJson: dateTimeToJson) DateTime? lastEdited,
- String? posterId,
- @Default("") String location,
- @Default("") String description,
- @Default("") String descriptionPlain,
- String? bannerDownloadURL,
- String? blurhash,
- String? linkedURL,
- @Default(ActivityCategory.leiden) ActivityCategory? category,
- @Default(true) bool sendNotification,
- @Default(true) bool createPhotoAlbum,
- String? photosFolderIdPublic,
- @JsonKey(fromJson: colorFromJson, toJson: colorToJson) @Default(Color(0xff006600)) Color color,
- @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;