PollOption class final
Describes one answer option of a poll
Constructors
-
PollOption({required String id, required 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}) -
Describes one answer option of a poll
const
-
PollOption.fromJson(Map<
String, dynamic> json) -
Parses a PollOption from TDLib JSON.
factory
Properties
- additionDate → int
-
Point in time (Unix timestamp) when the option was added; 0 if the option existed from creation of the poll
final
-
Identifier of the user or chat who added the option; may be null if the option existed from creation of the poll
final
- clientId → int?
-
Identifier of the TDLib client that sent this object, when known.
no setterinherited
- 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 → String
-
Unique identifier of the option in the poll; may be empty if yet unassigned
final
- isBeingChosen → bool
-
True, if the option is being chosen by a pending setPollAnswer request
final
- isChosen → bool
-
True, if the option was chosen by the user
final
- media → PollMedia?
-
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> -
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
-
Option text; 1-100 characters; may contain only custom emoji entities
final
- votePercentage → int
-
The percentage of votes for this option; 0-100
final
- voterCount → int
-
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 -
Returns a copy with the given fields replaced. For a nullable
field pass a function, e.g.
field: () => nullto 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.