PollAnswer class abstract

This object represents an answer of a user in a non-anonymous poll.

Available extensions
Annotations
  • @freezed

Constructors

PollAnswer({@JsonKey.new(name: 'poll_id') required String pollId, @JsonKey.new(name: 'user') User? user, @JsonKey.new(name: 'option_ids') required List<int> optionIds, @JsonKey.new(name: 'voter_chat') Chat? voterChat})
Constructs a PollAnswer object
const
factory
PollAnswer.fromJson(Map<String, dynamic> json)
Creates a PollAnswer object from JSON object
factory

Properties

copyWith → $PollAnswerCopyWith<PollAnswer>
Create a copy of PollAnswer with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
optionIds → List<int>
0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
no setterinherited
pollId → String
Unique poll identifier
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
user → User?
The user, who changed the answer to the poll
no setterinherited
voterChat → Chat?
Optional. The chat that changed the answer to the poll, if the voter is anonymous
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_PollAnswer value)) → TResult

Available on PollAnswer, provided by the PollAnswerPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_PollAnswer value)?) → TResult?

Available on PollAnswer, provided by the PollAnswerPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_PollAnswer value)?, {required TResult orElse()}) → TResult

Available on PollAnswer, provided by the PollAnswerPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this PollAnswer to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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