Poll class Null safety

Represents a poll

Annotations

Constructors

Poll({required int id, required String title, required int createdAt, required int updatedAt, required int closeAt, required PollStatus status, int? messageId, PollData? data, int voterCount = -1, List<PollOption> options = const [], String? createdBy, bool allowUserSuggestion = false, bool allowMultipleVotes = false, List<int>? votedPollOptionIds})
Poll.fromJson(Map<String, dynamic> json)
factory

Properties

allowMultipleVotes bool
Whether to allow multiple vote casting
read / write
allowUserSuggestion bool
Whether to allow user-suggested options
read / write
closeAt int
Unix timestamp at which the poll has closed or will close (second). If this value is -1, it means the poll is indefinitely open.
read / write
createdAt int
Unix timestamp at which the poll is created (millisecond)
final
createdBy String?
ID of the user who has created the poll
final
data PollData?
Additional information to accompany the poll. Can be used to provide explanations for incorrect quiz answers.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
id int
Unique id for this poll
final
messageId int?
final
options List<PollOption>
Lists of options for this current poll
read / write
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
status PollStatus
The status of the poll. The value is one of the following: "open", or "closed".
read / write
title String
Title of this poll
read / write
updatedAt int
Unix timestamp at which the poll is updated (millisecond)
read / write
votedPollOptionIds List<int>?
List of option ids which the user has voted on.
read / write
voterCount int
Number of voters who casted a vote on the poll
read / write

Methods

applyPollUpdateEvent(PollUpdateEvent event) bool
Applies PollUpdateEvent event to this message
applyPollVoteEvent(PollVoteEvent event) bool
Applies PollVoteEvent event to this message
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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

create({required PollCreateParams params, OnPollCallback? onCompleted}) Future<Poll>
Create Poll
get({required PollRetrievalParams params, OnPollCallback? onCompleted}) Future<Poll>
Get Poll