copyWith method

UserProfileModel copyWith({
  1. String? id,
  2. String? username,
  3. String? email,
  4. String? bio,
  5. String? avatarUrl,
  6. UserRole? role,
  7. AccountVerificationStatus? verificationStatus,
  8. DateTime? createdAt,
  9. DateTime? updatedAt,
})

Implementation

UserProfileModel copyWith({
  String? id,
  String? username,
  String? email,
  String? bio,
  String? avatarUrl,
  UserRole? role,
  AccountVerificationStatus? verificationStatus,
  DateTime? createdAt,
  DateTime? updatedAt,
}) {
  return UserProfileModel(
    id: id ?? this.id,
    username: username ?? this.username,
    email: email ?? this.email,
    bio: bio ?? this.bio,
    avatarUrl: avatarUrl ?? this.avatarUrl,
    role: role ?? this.role,
    verificationStatus: verificationStatus ?? this.verificationStatus,
    createdAt: createdAt ?? this.createdAt,
    updatedAt: updatedAt ?? this.updatedAt,
  );
}