PollOption class

Class representing a poll option. A poll options can be created by Poll.create and GroupChannelPoll.addPollOption. text is the only field set by the client. Other fields can be set by the server and voting.

A latest poll option instance can be fetched using Poll.get and a poll option can be updated using GroupChannelPoll.updatePoll.

Annotations

Constructors

PollOption({required int pollId, required int id, required String text, String? createdBy, required int createdAt, required int voteCount, required int updatedAt})
PollOption.fromJson(Map<String, dynamic> json)
factory

Properties

createdAt → int
Unix timestamp at which the poll option is created.
final
createdBy ↔ String?
UserId of the poll option creator.
read / write
hashCode → int
The hash code for this object.
read-onlyoverride
id → int
A unique identifier for this poll option.
final
pollId → int
A unique identifier for the poll which contains this poll option.
final
runtimeType → Type
A representation of the runtime type of the object.
read-onlyinherited
text → String
Representing text of this poll option.
final
updatedAt ↔ int
Unix timestamp at which the poll option is updated (ms).
read / write
voteCount ↔ int
Voter count of this poll option.
read / write

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

get(PollOptionRetrievalParams params, {Chat? chat}) → Future<PollOption>
Fetches latest PollOption representation from the server.