copyWith method

ChatUser copyWith({
  1. String? id,
  2. String? name,
  3. String? profilePhoto,
  4. ImageType? imageType,
  5. String? defaultAvatarImage,
  6. bool forceNullValue = false,
})

Implementation

ChatUser copyWith({
  String? id,
  String? name,
  String? profilePhoto,
  ImageType? imageType,
  String? defaultAvatarImage,
  bool forceNullValue = false,
}) {
  return ChatUser(
    id: id ?? this.id,
    name: name ?? this.name,
    imageType: imageType ?? this.imageType,
    profilePhoto:
        forceNullValue ? profilePhoto : profilePhoto ?? this.profilePhoto,
    defaultAvatarImage: defaultAvatarImage ?? this.defaultAvatarImage,
  );
}