Poll class

This object contains information about a poll.

Constructors

Poll({required String id, required String question, required List<PollOption> options, required int totalVoterCount, required bool isClosed, required bool isAnonymous, required PollType type, required bool allowsMultipleAnswers, int? correctOptionId, String? explanation, List<MessageEntity>? explanationEntities, int? openPeriod, int? closeDate})
Basic constructor

Properties

allowsMultipleAnswers bool
True, if the poll allows multiple answers
getter/setter pair
closeDate int?
Optional. Point in time (Unix timestamp) when the poll will be automatically closed
getter/setter pair
correctOptionId int?
Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
getter/setter pair
explanation String?
Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
getter/setter pair
explanationEntities List<MessageEntity>?
Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String
Unique poll identifier
getter/setter pair
isAnonymous bool
True, if the poll is anonymous
getter/setter pair
isClosed bool
True, if the poll is closed
getter/setter pair
openPeriod int?
Optional. Amount of time in seconds the poll will be active after creation
getter/setter pair
options List<PollOption>
List of poll options
getter/setter pair
question String
Poll question, 1-300 characters
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalVoterCount int
Total number of users that voted in the poll
getter/setter pair
type PollType
Poll type, currently can be “regular” or “quiz”
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map
Creates a json from the object
toString() String
A string representation of this object.
override

Operators

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

Static Methods

fromJson(Map<String, dynamic> json) Poll
Creates a object from a json