copyWith method
UpgradedGift
copyWith({
- int? id,
- int? regularGiftId,
- int? publisherChatId,
- String? title,
- String? name,
- int? number,
- int? totalUpgradedCount,
- int? maxUpgradedCount,
- bool? isBurned,
- bool? isCrafted,
- bool? isPremium,
- bool? isThemeAvailable,
- int? usedThemeChatId,
- MessageSender? hostId()?,
- MessageSender? ownerId()?,
- String? ownerAddress,
- String? ownerName,
- String? giftAddress,
- bool? canBeTonWalletCardBackground,
- UpgradedGiftModel? model,
- UpgradedGiftSymbol? symbol,
- UpgradedGiftBackdrop? backdrop,
- UpgradedGiftOriginalDetails? originalDetails()?,
- UpgradedGiftColors? colors()?,
- GiftResaleParameters? resaleParameters()?,
- bool? canSendPurchaseOffer,
- int? craftProbabilityPerMille,
- String? valueCurrency,
- int? valueAmount,
- int? valueUsdAmount,
- 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
UpgradedGift copyWith({
int? id,
int? regularGiftId,
int? publisherChatId,
String? title,
String? name,
int? number,
int? totalUpgradedCount,
int? maxUpgradedCount,
bool? isBurned,
bool? isCrafted,
bool? isPremium,
bool? isThemeAvailable,
int? usedThemeChatId,
MessageSender? Function()? hostId,
MessageSender? Function()? ownerId,
String? ownerAddress,
String? ownerName,
String? giftAddress,
bool? canBeTonWalletCardBackground,
UpgradedGiftModel? model,
UpgradedGiftSymbol? symbol,
UpgradedGiftBackdrop? backdrop,
UpgradedGiftOriginalDetails? Function()? originalDetails,
UpgradedGiftColors? Function()? colors,
GiftResaleParameters? Function()? resaleParameters,
bool? canSendPurchaseOffer,
int? craftProbabilityPerMille,
String? valueCurrency,
int? valueAmount,
int? valueUsdAmount,
dynamic extra,
int? clientId,
}) => UpgradedGift(
id: id ?? this.id,
regularGiftId: regularGiftId ?? this.regularGiftId,
publisherChatId: publisherChatId ?? this.publisherChatId,
title: title ?? this.title,
name: name ?? this.name,
number: number ?? this.number,
totalUpgradedCount: totalUpgradedCount ?? this.totalUpgradedCount,
maxUpgradedCount: maxUpgradedCount ?? this.maxUpgradedCount,
isBurned: isBurned ?? this.isBurned,
isCrafted: isCrafted ?? this.isCrafted,
isPremium: isPremium ?? this.isPremium,
isThemeAvailable: isThemeAvailable ?? this.isThemeAvailable,
usedThemeChatId: usedThemeChatId ?? this.usedThemeChatId,
hostId: hostId != null ? hostId() : this.hostId,
ownerId: ownerId != null ? ownerId() : this.ownerId,
ownerAddress: ownerAddress ?? this.ownerAddress,
ownerName: ownerName ?? this.ownerName,
giftAddress: giftAddress ?? this.giftAddress,
canBeTonWalletCardBackground:
canBeTonWalletCardBackground ?? this.canBeTonWalletCardBackground,
model: model ?? this.model,
symbol: symbol ?? this.symbol,
backdrop: backdrop ?? this.backdrop,
originalDetails: originalDetails != null
? originalDetails()
: this.originalDetails,
colors: colors != null ? colors() : this.colors,
resaleParameters: resaleParameters != null
? resaleParameters()
: this.resaleParameters,
canSendPurchaseOffer: canSendPurchaseOffer ?? this.canSendPurchaseOffer,
craftProbabilityPerMille:
craftProbabilityPerMille ?? this.craftProbabilityPerMille,
valueCurrency: valueCurrency ?? this.valueCurrency,
valueAmount: valueAmount ?? this.valueAmount,
valueUsdAmount: valueUsdAmount ?? this.valueUsdAmount,
extra: extra ?? this.extra,
clientId: clientId ?? this.clientId,
);