Gift class abstract

Represents a gift that can be sent by the bot.

Available extensions
Annotations
  • @freezed

Constructors

Gift({@JsonKey.new(name: 'id') required String id, @JsonKey.new(name: 'sticker') required Sticker sticker, @JsonKey.new(name: 'star_count') required int starCount, @JsonKey.new(name: 'total_count') int? totalCount, @JsonKey.new(name: 'remaining_count') int? remainingCount, @JsonKey.new(name: 'upgrade_star_count') int? upgradeStarCount, @JsonKey.new(name: 'publisher_chat') Chat? publisherChat, @JsonKey.new(name: 'personal_remaining_count') int? personalRemainingCount, @JsonKey.new(name: 'personal_total_count') int? personalTotalCount, @JsonKey.new(name: 'is_premium') bool? isPremium, @JsonKey.new(name: 'has_colors') bool? hasColors, @JsonKey.new(name: 'background') GiftBackground? background, @JsonKey.new(name: 'unique_gift_variant_count') int? uniqueGiftVariantCount})
Creates a Gift object.
const
factory
Gift.fromJson(Map<String, dynamic> json)
Creates a Gift object from a JSON map.
factory

Properties

background GiftBackground?
Optional. Background of the gift
no setterinherited
copyWith → $GiftCopyWith<Gift>
Create a copy of Gift with the given fields replaced by the non-null parameter values.
no setterinherited
hasColors bool?
Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier of the gift.
no setterinherited
isPremium bool?
Optional. True, if the gift can only be purchased by Telegram Premium subscribers
no setterinherited
personalRemainingCount int?
Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only
no setterinherited
personalTotalCount int?
Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only
no setterinherited
publisherChat Chat?
Optional. Information about the chat that published the gift
no setterinherited
remainingCount int?
Optional. The number of remaining gifts of this type that can be sent; for limited gifts only.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
starCount int
The number of Telegram Stars that must be paid to send the sticker.
no setterinherited
sticker Sticker
The sticker that represents the gift.
no setterinherited
totalCount int?
Optional. The total number of gifts of this type that can be sent; for limited gifts only.
no setterinherited
uniqueGiftVariantCount int?
Optional. The total number of different unique gifts that can be obtained by upgrading the gift
no setterinherited
upgradeStarCount int?
Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Gift value)) → TResult

Available on Gift, provided by the GiftPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Gift value)?) → TResult?

Available on Gift, provided by the GiftPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Gift value)?, {required TResult orElse()}) → TResult

Available on Gift, provided by the GiftPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Gift to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

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