copyWith method
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,
})
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,
);
}