copyWith method
User
copyWith({
- int? id,
- String? firstName,
- String? lastName,
- Usernames? usernames()?,
- String? phoneNumber,
- UserStatus? status,
- ProfilePhoto? profilePhoto()?,
- int? accentColorId,
- int? backgroundCustomEmojiId,
- UpgradedGiftColors? upgradedGiftColors()?,
- int? profileAccentColorId,
- int? profileBackgroundCustomEmojiId,
- EmojiStatus? emojiStatus()?,
- bool? isContact,
- bool? isMutualContact,
- bool? isCloseFriend,
- VerificationStatus? verificationStatus()?,
- bool? isPremium,
- bool? isSupport,
- RestrictionInfo? restrictionInfo()?,
- ActiveStoryState? activeStoryState()?,
- bool? restrictsNewChats,
- int? paidMessageStarCount,
- bool? haveAccess,
- UserType? type,
- String? languageCode,
- bool? addedToAttachmentMenu,
- dynamic extra,
- int? clientId,
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g. field: () => null to clear it.
Implementation
User copyWith({
int? id,
String? firstName,
String? lastName,
Usernames? Function()? usernames,
String? phoneNumber,
UserStatus? status,
ProfilePhoto? Function()? profilePhoto,
int? accentColorId,
int? backgroundCustomEmojiId,
UpgradedGiftColors? Function()? upgradedGiftColors,
int? profileAccentColorId,
int? profileBackgroundCustomEmojiId,
EmojiStatus? Function()? emojiStatus,
bool? isContact,
bool? isMutualContact,
bool? isCloseFriend,
VerificationStatus? Function()? verificationStatus,
bool? isPremium,
bool? isSupport,
RestrictionInfo? Function()? restrictionInfo,
ActiveStoryState? Function()? activeStoryState,
bool? restrictsNewChats,
int? paidMessageStarCount,
bool? haveAccess,
UserType? type,
String? languageCode,
bool? addedToAttachmentMenu,
dynamic extra,
int? clientId,
}) => User(
id: id ?? this.id,
firstName: firstName ?? this.firstName,
lastName: lastName ?? this.lastName,
usernames: usernames != null ? usernames() : this.usernames,
phoneNumber: phoneNumber ?? this.phoneNumber,
status: status ?? this.status,
profilePhoto: profilePhoto != null ? profilePhoto() : this.profilePhoto,
accentColorId: accentColorId ?? this.accentColorId,
backgroundCustomEmojiId:
backgroundCustomEmojiId ?? this.backgroundCustomEmojiId,
upgradedGiftColors: upgradedGiftColors != null
? upgradedGiftColors()
: this.upgradedGiftColors,
profileAccentColorId: profileAccentColorId ?? this.profileAccentColorId,
profileBackgroundCustomEmojiId:
profileBackgroundCustomEmojiId ?? this.profileBackgroundCustomEmojiId,
emojiStatus: emojiStatus != null ? emojiStatus() : this.emojiStatus,
isContact: isContact ?? this.isContact,
isMutualContact: isMutualContact ?? this.isMutualContact,
isCloseFriend: isCloseFriend ?? this.isCloseFriend,
verificationStatus: verificationStatus != null
? verificationStatus()
: this.verificationStatus,
isPremium: isPremium ?? this.isPremium,
isSupport: isSupport ?? this.isSupport,
restrictionInfo: restrictionInfo != null
? restrictionInfo()
: this.restrictionInfo,
activeStoryState: activeStoryState != null
? activeStoryState()
: this.activeStoryState,
restrictsNewChats: restrictsNewChats ?? this.restrictsNewChats,
paidMessageStarCount: paidMessageStarCount ?? this.paidMessageStarCount,
haveAccess: haveAccess ?? this.haveAccess,
type: type ?? this.type,
languageCode: languageCode ?? this.languageCode,
addedToAttachmentMenu: addedToAttachmentMenu ?? this.addedToAttachmentMenu,
extra: extra ?? this.extra,
clientId: clientId ?? this.clientId,
);