copyWith method

UserPublic copyWith({
  1. String? userId,
  2. String? mail,
  3. String? firstname,
  4. String? lastname,
  5. Phone? phone,
  6. Timestamp? lastSignIn,
  7. UserPermissions? permissions,
  8. Map<String, String>? othersAttributes,
})

Creates a copy of the user with updated fields

Implementation

UserPublic copyWith({
  String? userId,
  String? mail,
  String? firstname,
  String? lastname,
  Phone? phone,
  Timestamp? lastSignIn,
  UserPermissions? permissions,
  Map<String, String>? othersAttributes,
}) {
  return UserPublic()
    ..userId = userId ?? this.userId
    ..mail = mail ?? this.mail
    ..firstname = firstname ?? this.firstname
    ..lastname = lastname ?? this.lastname
    ..phone = phone ?? this.phone
    ..lastSignIn = lastSignIn ?? this.lastSignIn
    ..permissions = permissions ?? this.permissions
    ..othersAttributes.addAll(othersAttributes ?? this.othersAttributes);
}