copyWith method

SharedChat copyWith({
  1. int? chatId,
  2. String? title,
  3. String? username,
  4. 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

SharedChat copyWith({
  int? chatId,
  String? title,
  String? username,
  Photo? Function()? photo,
}) => SharedChat(
  chatId: chatId ?? this.chatId,
  title: title ?? this.title,
  username: username ?? this.username,
  photo: photo != null ? photo() : this.photo,
);