copyWith method
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g. field: () => null to clear it.
Implementation
SharedUser copyWith({
int? userId,
String? firstName,
String? lastName,
String? username,
Photo? Function()? photo,
}) => SharedUser(
userId: userId ?? this.userId,
firstName: firstName ?? this.firstName,
lastName: lastName ?? this.lastName,
username: username ?? this.username,
photo: photo != null ? photo() : this.photo,
);