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

Retrieve a list of polls

Copy link

Create a PollListQuery instance to retrieve a list of polls matching the specifications set by PollListQueryParams. After a list of polls is successfully retrieved, you can access the data of each polls from the result list through the polls parameter of the callback handler.

try {
  final query = await PollListQuery(
    PollListQueryParams(
      channelType: channel.channelType,
      channelUrl: channel.channelUrl,
    ),
  );
  final polls = await query.next();
} catch (e) {
  // Handle error.
}

PollListQueryParams

Copy link
Parameter nameTypeDescription

channelType

ChannelType

Specifies the type of the channel.

channelUrl

String

Specifies the URL of the channel.

limit

int?

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