copyWith method

BlogPost copyWith({
  1. int? id,
  2. String? title,
  3. String? slug,
  4. String? excerpt,
  5. String? content,
  6. String? featuredImage,
  7. String? author,
  8. bool? isPublished,
  9. DateTime? publishedAt,
  10. DateTime? createdAt,
  11. DateTime? updatedAt,
  12. int? appId,
})

Implementation

BlogPost copyWith({
  int? id,
  String? title,
  String? slug,
  String? excerpt,
  String? content,
  String? featuredImage,
  String? author,
  bool? isPublished,
  DateTime? publishedAt,
  DateTime? createdAt,
  DateTime? updatedAt,
  int? appId,
}) {
  return BlogPost(
    id: id ?? this.id,
    title: title ?? this.title,
    slug: slug ?? this.slug,
    excerpt: excerpt ?? this.excerpt,
    content: content ?? this.content,
    featuredImage: featuredImage ?? this.featuredImage,
    author: author ?? this.author,
    isPublished: isPublished ?? this.isPublished,
    publishedAt: publishedAt ?? this.publishedAt,
    createdAt: createdAt ?? this.createdAt,
    updatedAt: updatedAt ?? this.updatedAt,
    appId: appId ?? this.appId,
  );
}