Gift class final

Describes a gift that can be sent to another user or channel chat

Inheritance
Available extensions
Annotations
  • @immutable

Constructors

Gift({required int id, required int publisherChatId, Sticker? sticker, required int starCount, required int defaultSellStarCount, required int upgradeStarCount, required int upgradeVariantCount, required bool hasColors, required bool isForBirthday, required bool isPremium, GiftAuction? auctionInfo, required int nextSendDate, GiftPurchaseLimits? userLimits, GiftPurchaseLimits? overallLimits, GiftBackground? background, required int firstSendDate, required int lastSendDate})

Properties

auctionInfo GiftAuction?
auctionInfo Information about the auction on which the gift can be purchased; may be null if the gift can be purchased directly
final
background GiftBackground?
background Background of the gift
final
defaultSellStarCount int
defaultSellStarCount Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed
final
firstSendDate int
firstSendDate Point in time (Unix timestamp) when the gift was sent for the first time; for sold out gifts only
final
hasColors bool
hasColors True, if the gift can be used to customize the user's name, and backgrounds of profile photo, reply header, and link preview
final
hashCode int
The hash code for this object.
no setteroverride
id int
id Unique identifier of the gift
final
isForBirthday bool
isForBirthday True, if the gift is a birthday gift
final
isPremium bool
isPremium True, if the gift can be bought only by Telegram Premium subscribers
final
lastSendDate int
lastSendDate Point in time (Unix timestamp) when the gift was sent for the last time; for sold out gifts only
final
nextSendDate int
nextSendDate Point in time (Unix timestamp) when the gift can be sent next time by the current user; may be 0 or a date in the past. If the date is in the future, then call canSendGift to get the reason, why the gift can't be sent now
final
overallLimits GiftPurchaseLimits?
overallLimits Number of times the gift can be purchased by all users; may be null if not limited
final
publisherChatId int
publisherChatId Identifier of the chat that published the gift; 0 if none
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
starCount int
starCount Number of Telegram Stars that must be paid for the gift
final
sticker Sticker?
sticker The sticker representing the gift
final
upgradeStarCount int
upgradeStarCount Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible
final
upgradeVariantCount int
upgradeVariantCount Number of unique gift variants that are available for the upgraded gift; 0 if unknown
final
userLimits GiftPurchaseLimits?
userLimits Number of times the gift can be purchased by the current user; may be null if not limited
final

Methods

copyWith({int? id, int? publisherChatId, Sticker? sticker, int? starCount, int? defaultSellStarCount, int? upgradeStarCount, int? upgradeVariantCount, bool? hasColors, bool? isForBirthday, bool? isPremium, GiftAuction? auctionInfo, int? nextSendDate, GiftPurchaseLimits? userLimits, GiftPurchaseLimits? overallLimits, GiftBackground? background, int? firstSendDate, int? lastSendDate}) Gift

Available on Gift, provided by the GiftExtensions extension

getConstructor() String
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(Map<String, dynamic>? json) Gift?

Constants

constructor → const String