copyWith method
Creates a copy with updated fields
Implementation
User copyWith({
String? id,
String? email,
String? name,
List<String>? roles,
bool? emailVerified,
DateTime? createdAt,
DateTime? updatedAt,
Map<String, dynamic>? metadata,
}) {
return User(
id: id ?? this.id,
email: email ?? this.email,
name: name ?? this.name,
roles: roles ?? this.roles,
emailVerified: emailVerified ?? this.emailVerified,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
metadata: metadata ?? this.metadata,
);
}