copyWith method

User copyWith({
  1. String? username,
  2. String? userID,
  3. String? firstName,
  4. String? middleName,
  5. String? familyName,
  6. String? preferredName,
  7. String? emailAddress,
  8. bool? emailAddressVerified,
  9. String? mobilePhone,
  10. bool? mobilePhoneVerified,
  11. String? profilePictureUrl,
  12. bool? rememberFor24h,
  13. bool? enableBiometric,
  14. bool? enableMFA,
  15. bool? enableTOTP,
  16. Map<String, String?> userProfile = const {},
})

Implementation

User copyWith({
  String? username,
  String? userID,
  String? firstName,
  String? middleName,
  String? familyName,
  String? preferredName,
  String? emailAddress,
  bool? emailAddressVerified,
  String? mobilePhone,
  bool? mobilePhoneVerified,
  String? profilePictureUrl,
  bool? rememberFor24h,
  bool? enableBiometric,
  bool? enableMFA,
  bool? enableTOTP,
  Map<String, String?> userProfile = const {},
}) {
  return User(
    username: username ?? this.username,
    userID: userID ?? this.userID,
    firstName: firstName ?? this.firstName,
    middleName: middleName ?? this.middleName,
    familyName: familyName ?? this.familyName,
    preferredName: preferredName ?? this.preferredName,
    emailAddress: emailAddress ?? this.emailAddress,
    emailAddressVerified: emailAddressVerified ?? this.emailAddressVerified,
    mobilePhone: mobilePhone ?? this.mobilePhone,
    mobilePhoneVerified: mobilePhoneVerified ?? this.mobilePhoneVerified,
    profilePictureUrl: profilePictureUrl ?? this.profilePictureUrl,
    rememberFor24h: rememberFor24h ?? this.rememberFor24h,
    enableBiometric: enableBiometric ?? this.enableBiometric,
    enableMFA: enableMFA ?? this.enableMFA,
    enableTOTP: enableTOTP ?? this.enableTOTP,
    userProfile: Map<String, String?>.from(this.userProfile)
      ..addAll(userProfile),
  );
}