Gift class final

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

Inheritance

Constructors

Gift({required int id, required int publisherChatId, required 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})
Describes a gift that can be sent to another user or channel chat
const
Gift.fromJson(Map<String, dynamic> json)
Parses a Gift from TDLib JSON.
factory

Properties

auctionInfo → GiftAuction?
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 of the gift; may be null if the gift has no background
final
clientId → int?
Identifier of the TDLib client that sent this object, when known.
no setterinherited
defaultSellStarCount → int
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
extra → dynamic
"@extra" of the request this object answers; null for updates.
no setterinherited
firstSendDate → int
Point in time (Unix timestamp) when the gift was sent for the first time; for sold out gifts only
final
hasColors → bool
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 setterinherited
id → int
Unique identifier of the gift
final
isForBirthday → bool
True, if the gift is a birthday gift
final
isPremium → bool
True, if the gift can be bought only by Telegram Premium subscribers
final
lastSendDate → int
Point in time (Unix timestamp) when the gift was sent for the last time; for sold out gifts only
final
nextSendDate → int
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?
Number of times the gift can be purchased by all users; may be null if not limited
final
publisherChatId → int
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
Number of Telegram Stars that must be paid for the gift
final
sticker → Sticker
The sticker representing the gift
final
upgradeStarCount → int
Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible
final
upgradeVariantCount → int
Number of unique gift variants that are available for the upgraded gift; 0 if unknown
final
userLimits → GiftPurchaseLimits?
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
Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.
getConstructor() → String
TDLib type name, e.g. updateNewMessage.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this object to TDLib JSON.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

CONSTRUCTOR → const String
TDLib type name.