Poll class
Represents a poll
- Annotations
-
- @JsonSerializable()
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
getter/setter pair
- allowUserSuggestion ↔ bool
-
Whether to allow user-suggested options
getter/setter pair
- 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.
getter/setter pair
- 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.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
Unique id for this poll
final
- messageId → int?
-
final
-
options
↔ List<
PollOption> -
Lists of options for this current poll
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status ↔ PollStatus
-
The status of the poll.
The value is one of the following: "open", or "closed".
getter/setter pair
- title ↔ String
-
Title of this poll
getter/setter pair
- updatedAt ↔ int
-
Unix timestamp at which the poll is updated (millisecond)
getter/setter pair
-
votedPollOptionIds
↔ List<
int> ? -
List of option ids which the user has voted on.
getter/setter pair
- voterCount ↔ int
-
Number of voters who casted a vote on the poll
getter/setter pair
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 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
-
create(
{required PollCreateParams params, OnPollCallback? onCompleted}) → Future< Poll> - Create Poll
-
get(
{required PollRetrievalParams params, OnPollCallback? onCompleted}) → Future< Poll> - Get Poll