PollData class

A poll in the Stream Feeds system.

Interactive content embedded within activities to gather user feedback. Supports multiple voting modes, user-suggested options, real-time vote tracking, and comprehensive analytics.

Available extensions
Annotations
  • @freezed

Constructors

PollData.new({required bool allowAnswers, required bool allowUserSuggestedOptions, required int answersCount, required DateTime createdAt, required String createdById, required String description, required bool enforceUniqueVote, required String id, required bool isClosed, required List<PollVoteData> latestAnswers, required Map<String, List<PollVoteData>> latestVotesByOption, required String name, required List<PollOptionData> options, required List<PollVoteData> ownVotesAndAnswers, required DateTime updatedAt, required int voteCount, required Map<String, int> voteCountsByOption, required String votingVisibility, UserData? createdBy, int? maxVotesAllowed, Map<String, Object?>? custom})
Creates a new PollData instance.
const

Properties

allowAnswers bool
Whether answers are allowed.
final
allowUserSuggestedOptions bool
Whether user-suggested options are allowed.
final
answersCount int
The number of answers.
final
copyWith → $PollDataCopyWith<PollData>
Create a copy of PollData with the given fields replaced by the non-null parameter values.
no setterinherited
createdAt DateTime
The date and time when the poll was created.
final
createdBy UserData?
The user who created the poll, if available.
final
createdById String
The ID of the user who created the poll.
final
custom Map<String, Object?>?
Custom data as a map.
final
description String
The description of the poll.
final
enforceUniqueVote bool
Whether unique voting is enforced.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for the poll.
final
isClosed bool
Whether the poll is closed.
final
latestAnswers List<PollVoteData>
The latest answers to the poll.
final
latestVotes List<PollVoteData>
List of votes received by the poll.
no setter
latestVotesByOption Map<String, List<PollVoteData>>
The latest votes by option.
final
maxVotesAllowed int?
The maximum number of votes allowed, if any.
final
name String
The name of the poll.
final
options List<PollOptionData>
The options for the poll.
final
ownAnswers List<PollVoteData>
List of answers provided by the current user.
no setter
ownVotes List<PollVoteData>
List of votes casted by the current user.
no setter
ownVotesAndAnswers List<PollVoteData>
The votes made by the current user.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updatedAt DateTime
The date and time when the poll was last updated.
final
voteCount int
The total number of votes.
final
voteCountsByOption Map<String, int>
The number of votes by option.
final
votingVisibility String
The visibility of voting.
final

Methods

addOption(PollOptionData option) PollData

Available on PollData, provided by the PollDataMutations extension

castAnswer(PollVoteData answer, String currentUserId) PollData

Available on PollData, provided by the PollDataMutations extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeOption(String optionId) PollData

Available on PollData, provided by the PollDataMutations extension

toString() String
A string representation of this object.
inherited
updateOption(PollOptionData option) PollData

Available on PollData, provided by the PollDataMutations extension

Operators

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