copyWith method

PageBlockRelatedArticle copyWith({
  1. String? url,
  2. String? title,
  3. String? description,
  4. Photo? photo()?,
  5. String? author,
  6. int? publishDate,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

PageBlockRelatedArticle copyWith({
  String? url,
  String? title,
  String? description,
  Photo? Function()? photo,
  String? author,
  int? publishDate,
}) =>
    PageBlockRelatedArticle(
      url: url ?? this.url,
      title: title ?? this.title,
      description: description ?? this.description,
      photo: photo != null ? photo() : this.photo,
      author: author ?? this.author,
      publishDate: publishDate ?? this.publishDate,
    );