PollOption class final

Describes one answer option of a poll

Inheritance
Available extensions
Annotations
  • @immutable

Constructors

PollOption({required String id, FormattedText? text, PollMedia? media, required int voterCount, required int votePercentage, required List<MessageSender> recentVoterIds, required bool isChosen, required bool isBeingChosen, MessageSender? author, required int additionDate})

Properties

additionDate → int
additionDate Point in time (Unix timestamp) when the option was added; 0 if the option existed from creation of the poll
final
author → MessageSender?
author Identifier of the user or chat who added the option; may be null if the option existed from creation of the poll
final
hashCode → int
The hash code for this object.
no setteroverride
id → String
id Unique identifier of the option in the poll; may be empty if yet unassigned
final
isBeingChosen → bool
isBeingChosen True, if the option is being chosen by a pending setPollAnswer request
final
isChosen → bool
isChosen True, if the option was chosen by the user
final
media → PollMedia?
media Option media; may be null if none. If present, currently, can be only of the types pollMediaAnimation, pollMediaLink, pollMediaLocation, pollMediaPhoto, pollMediaSticker, pollMediaVenue, or pollMediaVideo
final
recentVoterIds → List<MessageSender>
recentVoterIds Identifiers of recent voters for the option, 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
text → FormattedText?
text Option text; 1-100 characters; may contain only custom emoji entities
final
votePercentage → int
votePercentage The percentage of votes for this option; 0-100
final
voterCount → int
voterCount Number of voters for this option, available only for closed or voted polls, or if the current user is the creator of the poll
final

Methods

copyWith({String? id, FormattedText? text, PollMedia? media, int? voterCount, int? votePercentage, List<MessageSender>? recentVoterIds, bool? isChosen, bool? isBeingChosen, MessageSender? author, int? additionDate}) → PollOption

Available on PollOption, provided by the PollOptionExtensions 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) → PollOption?

Constants

constructor → const String