copyWith method
PageBlockEmbeddedPost
copyWith({
- String? url,
- String? author,
- Photo? authorPhoto()?,
- int? date,
- List<
PageBlock> ? blocks, - PageBlockCaption? caption()?,
override
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g. field: () => null to clear it.
Implementation
@override
PageBlockEmbeddedPost copyWith({
String? url,
String? author,
Photo? Function()? authorPhoto,
int? date,
List<PageBlock>? blocks,
PageBlockCaption? Function()? caption,
}) => PageBlockEmbeddedPost(
url: url ?? this.url,
author: author ?? this.author,
authorPhoto: authorPhoto != null ? authorPhoto() : this.authorPhoto,
date: date ?? this.date,
blocks: blocks ?? this.blocks,
caption: caption != null ? caption() : this.caption,
);