copyWith method

  1. @override
MessagePremiumGiftCode copyWith({
  1. MessageSender? creatorId()?,
  2. bool? isFromGiveaway,
  3. bool? isUnclaimed,
  4. String? currency,
  5. int? amount,
  6. String? cryptocurrency,
  7. int? cryptocurrencyAmount,
  8. int? monthCount,
  9. Sticker? sticker()?,
  10. String? code,
})
override

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

@override
MessagePremiumGiftCode copyWith({
  MessageSender? Function()? creatorId,
  bool? isFromGiveaway,
  bool? isUnclaimed,
  String? currency,
  int? amount,
  String? cryptocurrency,
  int? cryptocurrencyAmount,
  int? monthCount,
  Sticker? Function()? sticker,
  String? code,
}) =>
    MessagePremiumGiftCode(
      creatorId: creatorId != null ? creatorId() : this.creatorId,
      isFromGiveaway: isFromGiveaway ?? this.isFromGiveaway,
      isUnclaimed: isUnclaimed ?? this.isUnclaimed,
      currency: currency ?? this.currency,
      amount: amount ?? this.amount,
      cryptocurrency: cryptocurrency ?? this.cryptocurrency,
      cryptocurrencyAmount: cryptocurrencyAmount ?? this.cryptocurrencyAmount,
      monthCount: monthCount ?? this.monthCount,
      sticker: sticker != null ? sticker() : this.sticker,
      code: code ?? this.code,
    );