/ SDKs / Flutter
SDKs
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Flutter
Version 4

Update a poll

Copy link

You can update a poll by creating and passing a PollUpdateParams object as an argument to the parameter in the updatePoll() method.

try {
  final poll = await channel.updatePoll(
    pollId: POLL_ID,
    params: PollUpdateParams(title: 'UPDATED_TITLE'),
  );
} catch (e) {
  // Handle error.
}

PollUpdateParams

Copy link
Parameter nameTypeDescription

title

String?

Specifies the title of a poll.

data

PollData?

Specifies an additional data to accompany the poll. A use case might be to provide explanations for incorrect quiz answers.

allowUserSuggestion

bool?

Determines whether to allow users to make suggestions. (Default: false)

allowMultipleVotes

bool?

Determines whether to allow users to vote on more than one poll options. (Default: false)

closeAt

int

Specifies the time when a poll has closed or will close in Unix seconds. If the value of this property is -1, the poll status remains open meaning that the poll will never close.