Poll class final
Poll (poll) - basic class
Describes a poll.
- id: Unique poll identifier.
- question: Poll question; 1-300 characters. Only custom emoji entities are allowed.
- options: List of poll answer options.
- totalVoterCount: Total number of voters, participating in the poll.
- recentVoterIds: Identifiers of recent voters, if the poll is non-anonymous.
- isAnonymous: True, if the poll is anonymous.
- type: Type of the poll.
- openPeriod: Amount of time the poll will be active after creation, in seconds.
- closeDate: Point in time (Unix timestamp) when the poll will automatically be closed.
- isClosed: True, if the poll is closed.
Constructors
-
Poll({required int id, required FormattedText question, required List<
PollOption> options, required int totalVoterCount, required List<MessageSender> recentVoterIds, required bool isAnonymous, required PollType type, required int openPeriod, required int closeDate, required bool isClosed}) -
Poll (poll) - basic class
const
-
Poll.fromJson(Map<
String, dynamic> json) -
Parse from a json
factory
Properties
- clientId → int?
-
Client ID, from which this object was received
no setterinherited
- closeDate → int
-
Point in time (Unix timestamp) when the poll will automatically be closed
final
- currentObjectId → String
-
TDLib object type for current class instance
no setteroverride
- extra → dynamic
-
A sign from TDLib update
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
- openPeriod → int
-
Amount of time the poll will be active after creation, in seconds
final
-
options
→ List<
PollOption> -
List of poll answer options
final
- question → FormattedText
-
Poll question; 1-300 characters. Only custom emoji entities are allowed
final
-
recentVoterIds
→ List<
MessageSender> -
Identifiers of recent voters, if the poll is non-anonymous
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
Methods
-
copyWith(
{int? id, FormattedText? question, List< PollOption> ? options, int? totalVoterCount, List<MessageSender> ? recentVoterIds, bool? isAnonymous, PollType? type, int? openPeriod, int? closeDate, bool? isClosed}) → Poll - Copy model with modified properties.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Convert model to TDLib JSON format
override
-
toString(
) → String -
Convert model to TDLib JSON format, encoded into String.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultObjectId → const String
- TDLib object type