copyWith method

ProductInfo copyWith({
  1. String? title,
  2. FormattedText? description,
  3. Photo? photo()?,
})

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

Implementation

ProductInfo copyWith({
  String? title,
  FormattedText? description,
  Photo? Function()? photo,
}) => ProductInfo(
  title: title ?? this.title,
  description: description ?? this.description,
  photo: photo != null ? photo() : this.photo,
);