PollOption.fromJson constructor

PollOption.fromJson(
  1. Map<String, dynamic> json
)

Creates a PollOption object from JSON object

Implementation

factory PollOption.fromJson(Map<String, dynamic> json) {
  return PollOption(
    text: json['text']!,
    voterCount: json['voter_count']!,
    textEntities: (json['text_entities'] as List<dynamic>?)
        ?.map((x) => MessageEntity.fromJson(x as Map<String, dynamic>))
        .toList(),
  );
}