PollData class

A poll included in a Tweet is not a primary object on any endpoint, but can be found and expanded in the Tweet object.

The object is available for expansion with expansions=attachments.poll_ids to get the condensed object with only default fields.

Use the expansion with the field parameter: poll.fields when requesting additional fields to complete the object.

Annotations
  • @freezed

Constructors

PollData({required String id, required List<PollOption> options, PollVotingStatus? votingStatus, int? durationMinutes, @JsonKey(name: 'end_datetime') DateTime? endAt})
const
factory
PollData.fromJson(Map<String, Object?> json)
factory

Properties

copyWith → $PollDataCopyWith<PollData>
no setterinherited
durationMinutes int?
Specifies the total duration of this poll.
no setterinherited
endAt DateTime?
Specifies the end date and time for this poll.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier of the expanded poll.
no setterinherited
options List<PollOption>
Contains objects describing each choice in the referenced poll.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
votingStatus → PollVotingStatus?
Indicates if this poll is still active and can receive votes, or if the voting is now closed.
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