ReceivedGift class final
Represents a gift received by a user or a chat
- Inheritance
- Available extensions
- Annotations
-
- @immutable
Constructors
-
ReceivedGift({required String receivedGiftId, MessageSender? senderId, FormattedText? text, required int uniqueGiftNumber, required bool isPrivate, required bool isSaved, required bool isPinned, required bool canBeUpgraded, required bool canBeTransferred, required bool wasRefunded, required int date, SentGift? gift, required List<
int> collectionIds, required int sellStarCount, required int prepaidUpgradeStarCount, required bool isUpgradeSeparate, required int transferStarCount, required int dropOriginalDetailsStarCount, required int nextTransferDate, required int nextResaleDate, required int exportDate, required String prepaidUpgradeHash, required int craftDate})
Properties
- canBeTransferred → bool
-
canBeTransferred True, if the gift is an upgraded gift that can be
transferred to another owner; only for the receiver of the gift
final
- canBeUpgraded → bool
-
canBeUpgraded True, if the gift is a regular gift that can be upgraded
to a unique gift; only for the receiver of the gift
final
-
collectionIds
→ List<
int> -
collectionIds Identifiers of collections to which the gift is added;
only for the receiver of the gift
final
- craftDate → int
-
craftDate Point in time (Unix timestamp) when the gift can be used to
craft another gift; can be in the past; only for the receiver of the gift
final
- date → int
-
date Point in time (Unix timestamp) when the gift was sent
final
- dropOriginalDetailsStarCount → int
-
dropOriginalDetailsStarCount Number of Telegram Stars that must be paid
to drop original details of the upgraded gift; 0 if not available; only
for the receiver of the gift
final
- exportDate → int
-
exportDate Point in time (Unix timestamp) when the upgraded gift can be
transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT
export isn't possible; only for the receiver of the gift
final
- gift → SentGift?
-
gift The gift
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isPinned → bool
-
isPinned True, if the gift is pinned to the top of the chat's profile
page
final
- isPrivate → bool
-
isPrivate True, if the sender and gift text are shown only to the gift
receiver; otherwise, everyone are able to see them
final
- isSaved → bool
-
isSaved True, if the gift is displayed on the chat's profile page; only
for the receiver of the gift
final
- isUpgradeSeparate → bool
-
isUpgradeSeparate True, if the upgrade was bought after the gift was
sent. In this case, prepaid upgrade cost must not be added to the gift
cost
final
- nextResaleDate → int
-
nextResaleDate Point in time (Unix timestamp) when the gift can be
resold to another user; can be in the past; 0 if the gift can't be resold;
only for the receiver of the gift
final
- nextTransferDate → int
-
nextTransferDate Point in time (Unix timestamp) when the gift can be
transferred to another owner; can be in the past; 0 if the gift can be
transferred immediately or transfer isn't possible; only for the receiver
of the gift
final
- prepaidUpgradeHash → String
-
prepaidUpgradeHash If non-empty, then the user can pay for an upgrade of
the gift using buyGiftUpgrade
final
- prepaidUpgradeStarCount → int
-
prepaidUpgradeStarCount Number of Telegram Stars that were paid by the
sender for the ability to upgrade the gift
final
- receivedGiftId → String
-
receivedGiftId Unique identifier of the received gift for the current
user; only for the receiver of the gift
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sellStarCount → int
-
sellStarCount Number of Telegram Stars that can be claimed by the
receiver instead of the regular gift; 0 if the gift can't be sold by the
current user
final
- senderId → MessageSender?
-
senderId Identifier of a user or a chat that sent the gift; may be null
if unknown
final
- text → FormattedText?
-
text Message added to the gift
final
- transferStarCount → int
-
transferStarCount Number of Telegram Stars that must be paid to transfer
the upgraded gift; only for the receiver of the gift
final
- uniqueGiftNumber → int
-
uniqueGiftNumber Unique number of the gift among gifts upgraded from the
same gift after upgrade; 0 if yet unassigned
final
- wasRefunded → bool
-
wasRefunded True, if the gift was refunded and isn't available anymore
final
Methods
-
copyWith(
{String? receivedGiftId, MessageSender? senderId, FormattedText? text, int? uniqueGiftNumber, bool? isPrivate, bool? isSaved, bool? isPinned, bool? canBeUpgraded, bool? canBeTransferred, bool? wasRefunded, int? date, SentGift? gift, List< int> ? collectionIds, int? sellStarCount, int? prepaidUpgradeStarCount, bool? isUpgradeSeparate, int? transferStarCount, int? dropOriginalDetailsStarCount, int? nextTransferDate, int? nextResaleDate, int? exportDate, String? prepaidUpgradeHash, int? craftDate}) → ReceivedGift -
Available on ReceivedGift, provided by the ReceivedGiftExtensions 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) → ReceivedGift?
Constants
- constructor → const String