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

Retrieve a list of voters

Copy link

Create a PollVoterListQuery instance to retrieve a list of voters matching the specifications set by PollVoterListQueryParams. After a list of voters is successfully retrieved, you can access the data of each voter from the result list through the votes parameter of the callback handler.

try {
  // Retrieve a list of voters.
  final query = await PollVoterListQuery(
    params: PollVoterListQueryParams(
      channelType: channel.channelType,
      channelUrl: channel.channelUrl,
      pollId: POLL_ID,
      pollOptionId: POLL_OPTIONS_ID,
    ),
  );
  final voters = await query.next();
} catch (e) {
  // Handle error.
}

PollVoterListQueryParams

Copy link
Parameter nameTypeDescription

channelType

ChannelType

Specifies the type of the channel.

channelUrl

String

Specifies the URL of the channel.

pollId

int

Specifies the unique ID of a poll.

pollOptionId

int

Specifies the unique ID of a poll option.

limit

int?

Specifies the number of results to retrieve per page. Acceptable values are 1 to 100, inclusive. (Default: 20)