copyWith method

UpgradedGift copyWith({
  1. int? id,
  2. int? regularGiftId,
  3. int? publisherChatId,
  4. String? title,
  5. String? name,
  6. int? number,
  7. int? totalUpgradedCount,
  8. int? maxUpgradedCount,
  9. bool? isBurned,
  10. bool? isCrafted,
  11. bool? isPremium,
  12. bool? isThemeAvailable,
  13. int? usedThemeChatId,
  14. MessageSender? hostId()?,
  15. MessageSender? ownerId()?,
  16. String? ownerAddress,
  17. String? ownerName,
  18. String? giftAddress,
  19. bool? canBeTonWalletCardBackground,
  20. UpgradedGiftModel? model,
  21. UpgradedGiftSymbol? symbol,
  22. UpgradedGiftBackdrop? backdrop,
  23. UpgradedGiftOriginalDetails? originalDetails()?,
  24. UpgradedGiftColors? colors()?,
  25. GiftResaleParameters? resaleParameters()?,
  26. bool? canSendPurchaseOffer,
  27. int? craftProbabilityPerMille,
  28. String? valueCurrency,
  29. int? valueAmount,
  30. int? valueUsdAmount,
  31. dynamic extra,
  32. 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,
);