Skip to main content

Submit Poll Vote

The submitPollVote() function is used to submit a vote for a poll. It takes a SubmitPollVoteRequest as input, which includes the pollId and the votes. The function returns an LMResponse<void> response as a Future.

Steps to Submit a Poll Vote

  1. Create an instance of SubmitPollVoteRequest with the required parameters: pollId and votes.
  2. Call the submitPollVote() function using the instance of the LMFeedClient class, passing the request as a parameter.
  3. Use the response as per your requirement.
// Create an instance of SubmitPollVoteRequest
SubmitPollVoteRequest request = SubmitPollVoteRequest(
pollId: "poll_id",
votes: ["vote1", "vote2"]
);

// Get the response from calling the function
final LMResponse<void> submitPollVoteResponse = await lmFeedClient.submitPollVote(request);

// Process the response, as per requirement
if (submitPollVoteResponse.success) {
// your function to handle successful submission of the poll vote
handleSubmitPollVoteSuccess();
} else {
// your function to handle error message
handleSubmitPollVoteError(submitPollVoteResponse.errorMessage);
}

Models

SubmitPollVoteRequest

List of parameters for the SubmitPollVoteRequest class

VariableTypeDescriptionOptional
pollIdStringUnique identifier of the poll
votesList<String>List of votes