Poll class

https://docs.joinmastodon.org/entities/poll/ Represents a poll attached to a status.

Annotations
  • @JsonSerializable()

Constructors

Poll({required String id, required DateTime? expiresAt, required bool expired, required bool multiple, required int votesCount, required int? votersCount, required bool? voted, required List<int>? ownVotes, required List<Option> options, required List<Emoji> emojis})
Poll.fromJson(Map<String, dynamic> json)
factory

Properties

emojis List<Emoji>
Custom emoji to be used for rendering poll options
final
expired bool
Is the poll currently expired?
final
expiresAt DateTime?
When the poll ends
final
hashCode int
The hash code for this object.
no setterinherited
id String
The ID of the poll in the database
final
multiple bool
Does the poll allow multiple-choice answers?
final
options List<Option>
Description: Possible answers for the poll. Type: Array of Hash
final
ownVotes List<int>?
When called with a user token, which options has the authorized user chosen? Contains an array of index values for options.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
voted bool?
When called with a user token, has the authorized user voted?
final
votersCount int?
How many unique accounts have voted on a multiple-choice poll
final
votesCount int
How many votes have been received
final

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.
inherited