copyWith method

User copyWith({
  1. List<String>? businessPhones,
  2. String? displayName,
  3. String? givenName,
  4. String? jobTitle,
  5. String? mail,
  6. String? mobilePhone,
  7. String? officeLocation,
  8. String? preferredLanguage,
  9. String? surname,
  10. String? userPrincipalName,
  11. String? id,
})

Returns a new User where the properties are the same as this one unless specified in the arguments.

The arguments specify new values for the corresponding properties in the returned User. If an argument is not provided or is null, the corresponding property in the returned User will have the same value as that property in this User.

Implementation

User copyWith({
  List<String>? businessPhones,
  String? displayName,
  String? givenName,
  String? jobTitle,
  String? mail,
  String? mobilePhone,
  String? officeLocation,
  String? preferredLanguage,
  String? surname,
  String? userPrincipalName,
  String? id,
}) {
  return User(
    businessPhones: businessPhones ?? this.businessPhones,
    displayName: displayName ?? this.displayName,
    givenName: givenName ?? this.givenName,
    jobTitle: jobTitle ?? this.jobTitle,
    mail: mail ?? this.mail,
    mobilePhone: mobilePhone ?? this.mobilePhone,
    officeLocation: officeLocation ?? this.officeLocation,
    preferredLanguage: preferredLanguage ?? this.preferredLanguage,
    surname: surname ?? this.surname,
    userPrincipalName: userPrincipalName ?? this.userPrincipalName,
    id: id ?? this.id,
  );
}