Giveaway class abstract

This object represents a message about a scheduled giveaway.

Available extensions
Annotations
  • @freezed

Constructors

Giveaway({@JsonKey.new(name: 'chats') required List<Chat> chats, @JsonKey.new(name: 'winners_selection_date') required int winnersSelectionDate, @JsonKey.new(name: 'winner_count') required int winnerCount, @JsonKey.new(name: 'only_new_members') bool? onlyNewMembers, @JsonKey.new(name: 'has_public_winners') bool? hasPublicWinners, @JsonKey.new(name: 'prize_description') String? prizeDescription, @JsonKey.new(name: 'country_codes') List<String>? countryCodes, @JsonKey.new(name: 'premium_subscription_month_count') int? premiumSubscriptionMonthCount, @JsonKey.new(name: 'prize_star_count') int? prizeStarCount})
Constructor
const
factory
Giveaway.fromJson(Map<String, dynamic> json)
Constructor from JSON data
factory

Properties

chats → List<Chat>
The list of chats which the user must join to participate in the giveaway
no setterinherited
copyWith → $GiveawayCopyWith<Giveaway>
Create a copy of Giveaway with the given fields replaced by the non-null parameter values.
no setterinherited
countryCodes → List<String>?
A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hasPublicWinners → bool?
True, if the list of giveaway winners will be visible to everyone
no setterinherited
onlyNewMembers → bool?
True, if only users who join the chats after the giveaway started should be eligible to win
no setterinherited
premiumSubscriptionMonthCount → int?
The number of months the Telegram Premium subscription won from the giveaway will be active for
no setterinherited
prizeDescription → String?
Description of additional giveaway prize
no setterinherited
prizeStarCount → int?
Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
winnerCount → int
The number of users which are supposed to be selected as winners of the giveaway
no setterinherited
winnersSelectionDate → int
Point in time (Unix timestamp) when winners of the giveaway will be selected
no setterinherited

Methods

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

Available on Giveaway, provided by the GiveawayPatterns extension

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

Available on Giveaway, provided by the GiveawayPatterns extension

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

Available on Giveaway, provided by the GiveawayPatterns 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 Giveaway to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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