toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() => <String, dynamic>{
  'id': id.toString(),
  'question': question?.toJson(),
  'options': options.map((item) => item.toJson()).toList(),
  'total_voter_count': totalVoterCount,
  'recent_voter_ids': recentVoterIds.map((item) => item.toJson()).toList(),
  'can_get_voters': canGetVoters,
  'can_see_results': canSeeResults,
  'is_anonymous': isAnonymous,
  'allows_multiple_answers': allowsMultipleAnswers,
  'allows_revoting': allowsRevoting,
  'members_only': membersOnly,
  'country_codes': countryCodes.map((item) => item).toList(),
  'option_order': optionOrder.map((item) => item).toList(),
  'type': type?.toJson(),
  'open_period': openPeriod,
  'close_date': closeDate,
  'is_closed': isClosed,
  'vote_restriction_reason': voteRestrictionReason?.toJson(),
  '@type': constructor,
};