PollOption constructor

const PollOption({
  1. @JsonKey(name: 'text') required String text,
  2. @JsonKey(name: 'voter_count') required int voterCount,
  3. @JsonKey(name: 'text_entities') List<MessageEntity>? textEntities,
})

Constructs a PollOption object.

Implementation

const factory PollOption({
  /// Option text, 1-100 characters
  @JsonKey(name: 'text') required String text,

  /// Number of users that voted for this option
  @JsonKey(name: 'voter_count') required int voterCount,

  /// Optional. Special entities that appear in the option text. Currently,
  /// only custom emoji entities are allowed in poll option texts
  @JsonKey(name: 'text_entities') List<MessageEntity>? textEntities,
}) = _PollOption;