createPollQuestion method

Future<PollQuestionModel?> createPollQuestion(
  1. dynamic question
)

Implementation

Future<PollQuestionModel?> createPollQuestion(question) {
  Log(
    logName: 'CreatePollQuestion',
    className: 'Poll',
    methodName: 'createPollQuestion',
    type: 'INFO',
    text:
        '{event: Create Poll Question, user: ${currentUser?.userPayloadId}, user is ${currentUser?.firstName} ${currentUser?.lastName}, uestion: $question',
  );
  return _httpService
      .createPollQuestion(question: question)
      .then((data) async {
    if (data.statusCode >= 200 && data.statusCode < 300) {
      var res = json.decode(data.body);

      PollQuestionModel pollQuestionData = PollQuestionModel.fromJson(res[0]);
      return pollQuestionData;
    }
    return null;
  });
}