toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  return {
    "anonymous": _isAnonymous,
    "duration": _duration?.inMilliseconds,
    "mode":
        HMSPollUserTrackingModeValues.getStringFromHMSPollUserTrackingMode(
            _mode),
    "poll_category":
        HMSPollCategoryValues.getStringFromHMSPollCategory(_pollCategory),
    "poll_id": _pollId,
    "questions": _questions.map((e) => e.toMap()).toList(),
    "roles_that_can_view_responses":
        _rolesThatCanViewResponse?.map((e) => e.name).toList(),
    "roles_that_can_vote": _rolesThatCanVote?.map((e) => e.name).toList(),
    "title": _title
  };
}