copyWith method

User copyWith({
  1. String? id,
  2. String? email,
  3. String? name,
  4. List<String>? roles,
  5. bool? emailVerified,
  6. DateTime? createdAt,
  7. DateTime? updatedAt,
  8. Map<String, dynamic>? metadata,
})

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,
  );
}