copyWith method

  1. @override
MessagePremiumGiftCode copyWith({
  1. MessageSender? creatorId()?,
  2. FormattedText? text,
  3. bool? isFromGiveaway,
  4. bool? isUnclaimed,
  5. String? currency,
  6. int? amount,
  7. String? cryptocurrency,
  8. int? cryptocurrencyAmount,
  9. int? monthCount,
  10. int? dayCount,
  11. Sticker? sticker()?,
  12. 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,
  FormattedText? text,
  bool? isFromGiveaway,
  bool? isUnclaimed,
  String? currency,
  int? amount,
  String? cryptocurrency,
  int? cryptocurrencyAmount,
  int? monthCount,
  int? dayCount,
  Sticker? Function()? sticker,
  String? code,
}) => MessagePremiumGiftCode(
  creatorId: creatorId != null ? creatorId() : this.creatorId,
  text: text ?? this.text,
  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,
  dayCount: dayCount ?? this.dayCount,
  sticker: sticker != null ? sticker() : this.sticker,
  code: code ?? this.code,
);