Changelog constructor

const Changelog({
  1. @JsonKey(name: 'id', required: true) required String id,
  2. @JsonKey(name: 'title', required: true) required String title,
  3. @JsonKey(name: 'content', required: true) required String content,
  4. @JsonKey(name: 'featuredImage') String? featuredImage,
  5. @JsonKey(name: 'organization', required: true) required String organization,
  6. @JsonKey(name: 'state', defaultValue: 'live') required String state,
  7. @JsonKey(name: 'locale', required: true) required String locale,
  8. @JsonKey(name: 'changelogCategories', required: true) required List<ChangelogCategory> changelogCategories,
  9. required DateTime date,
  10. @JsonKey(name: 'slug', required: true) required String slug,
  11. @JsonKey(name: 'isDraftDiffersFromLive', defaultValue: false) required bool isDraftDiffersFromLive,
  12. @JsonKey(name: 'isPublished', defaultValue: true) required bool isPublished,
  13. @JsonKey(name: 'availableLocales', required: true) required List<String> availableLocales,
  14. @JsonKey(name: 'publishedLocales', required: true) required List<String> publishedLocales,
})

Implementation

const factory Changelog({
  /// The unique ID.
  @JsonKey(name: 'id', required: true) required String id,

  /// The title of the changelog.
  @JsonKey(name: 'title', required: true) required String title,

  /// The content of the changelog.
  ///
  /// In HTML format.
  @JsonKey(name: 'content', required: true) required String content,

  /// The featured image of the changelog.
  @JsonKey(name: 'featuredImage') String? featuredImage,

  /// The ID of the organization that the changelog belongs to.
  @JsonKey(name: 'organization', required: true) required String organization,

  /// The state of the changelog, either "live" or "draft".
  @JsonKey(name: 'state', defaultValue: 'live') required String state,

  /// The locale of the changelog.
  @JsonKey(name: 'locale', required: true) required String locale,

  /// The categories of the changelog.
  @JsonKey(name: 'changelogCategories', required: true)
  required List<ChangelogCategory> changelogCategories,

  /// The date when the Changelog was created.
  required DateTime date,

  /// The URL-friendly slug of the changelog.
  @JsonKey(name: 'slug', required: true) required String slug,

  /// Indicates whether the draft version differs from the live published version.
  @JsonKey(name: 'isDraftDiffersFromLive', defaultValue: false)
  required bool isDraftDiffersFromLive,

  /// Indicates whether the changelog is published.
  @JsonKey(name: 'isPublished', defaultValue: true) required bool isPublished,

  /// An array of available locales for the changelog.
  @JsonKey(name: 'availableLocales', required: true)
  required List<String> availableLocales,

  /// An array of locales in which the changelog is published.
  @JsonKey(name: 'publishedLocales', required: true)
  required List<String> publishedLocales,
}) = _Changelog;