copyWith method

  1. @override
PageBlockEmbeddedPost copyWith({
  1. String? url,
  2. String? author,
  3. Photo? authorPhoto()?,
  4. int? date,
  5. List<PageBlock>? blocks,
  6. 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,
);