Poll class

Annotations
  • @freezed

Constructors

Poll({required String id, required int votesCount, int? votersCount, @JsonKey(name: 'multiple') required bool isMultiple, @JsonKey(name: 'voted') bool? isVoted, @JsonKey(name: 'expired') required bool isExpired, required List<PollOption> options, List<int>? ownVotes, required List<Emoji> emojis, DateTime? expiresAt})
const
factory
Poll.fromJson(Map<String, Object?> json)
factory

Properties

copyWith → $PollCopyWith<Poll>
no setterinherited
emojis List<Emoji>
Custom emoji to be used for rendering poll options.
no setterinherited
expiresAt DateTime?
When the poll ends.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
The ID of the poll in the database.
no setterinherited
isExpired bool
Is the poll currently expired?
no setterinherited
isMultiple bool
Does the poll allow multiple-choice answers?
no setterinherited
isVoted bool?
When called with a user token, has the authorized user voted?
no setterinherited
options List<PollOption>
Possible answers for the poll.
no setterinherited
ownVotes List<int>?
When called with a user token, which options has the authorized user chosen?
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
votersCount int?
How many unique accounts have voted on a multiple-choice poll.
no setterinherited
votesCount int
How many votes have been received.
no setterinherited

Methods

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

Operators

operator ==(Object other) bool
The equality operator.
inherited