PollOption class abstract

This object contains information about one answer option in a poll.

Available extensions
Annotations
  • @freezed

Constructors

PollOption({@JsonKey.new(name: 'text') required String text, @JsonKey.new(name: 'voter_count') required int voterCount, @JsonKey.new(name: 'text_entities') List<MessageEntity>? textEntities})
Constructs a PollOption object.
const
factory
PollOption.fromJson(Map<String, dynamic> json)
Creates a PollOption object from JSON object.
factory

Properties

copyWith → $PollOptionCopyWith<PollOption>
Create a copy of PollOption with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
Option text, 1-100 characters
no setterinherited
textEntities List<MessageEntity>?
Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts
no setterinherited
voterCount int
Number of users that voted for this option
no setterinherited

Methods

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

Available on PollOption, provided by the PollOptionPatterns extension

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

Available on PollOption, provided by the PollOptionPatterns extension

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

Available on PollOption, provided by the PollOptionPatterns 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 PollOption to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

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