Poll class final

Describes a poll

Inheritance

Constructors

Poll({required int id, required FormattedText question, required List<PollOption> options, required int totalVoterCount, required List<MessageSender> recentVoterIds, required bool canGetVoters, required bool canSeeResults, required bool isAnonymous, required bool allowsMultipleAnswers, required bool allowsRevoting, required bool membersOnly, required List<String> countryCodes, required List<int> optionOrder, required PollType type, required int openPeriod, required int closeDate, required bool isClosed, PollVoteRestrictionReason? voteRestrictionReason})
Describes a poll
const
Poll.fromJson(Map<String, dynamic> json)
Parses a Poll from TDLib JSON.
factory

Properties

allowsMultipleAnswers → bool
True, if multiple answer options can be chosen simultaneously
final
allowsRevoting → bool
True, if the poll can be answered multiple times
final
canGetVoters → bool
True, if the current user can get voters in the poll using getPollVoters
final
canSeeResults → bool
True, if the current user can see results of the poll
final
clientId → int?
Identifier of the TDLib client that sent this object, when known.
no setterinherited
closeDate → int
Point in time (Unix timestamp) when the poll will automatically be closed
final
countryCodes → List<String>
The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote. If empty, then all users can participate in the poll
final
extra → dynamic
"@extra" of the request this object answers; null for updates.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
id → int
Unique poll identifier
final
isAnonymous → bool
True, if the poll is anonymous
final
isClosed → bool
True, if the poll is closed
final
membersOnly → bool
True, if only the users that are members of the chat for more than a day will be able to vote
final
openPeriod → int
Amount of time the poll will be active after creation, in seconds
final
optionOrder → List<int>
The list of 0-based poll option identifiers in which the options of the poll must be shown; empty if the order of options must not be changed
final
options → List<PollOption>
List of poll answer options
final
question → FormattedText
Poll question; 1-300 characters; may contain only custom emoji entities
final
recentVoterIds → List<MessageSender>
Identifiers of recent voters, if the poll is non-anonymous and poll results are available
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
totalVoterCount → int
Total number of voters, participating in the poll
final
type → PollType
Type of the poll
final
voteRestrictionReason → PollVoteRestrictionReason?
The reason describing, why the current user can't vote in the poll; may be null if the user can vote in the poll
final

Methods

copyWith({int? id, FormattedText? question, List<PollOption>? options, int? totalVoterCount, List<MessageSender>? recentVoterIds, bool? canGetVoters, bool? canSeeResults, bool? isAnonymous, bool? allowsMultipleAnswers, bool? allowsRevoting, bool? membersOnly, List<String>? countryCodes, List<int>? optionOrder, PollType? type, int? openPeriod, int? closeDate, bool? isClosed, PollVoteRestrictionReason? voteRestrictionReason()?}) → Poll
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.