loadNext method Null safety
override
Load next items asynchronously
Implementation
@override
Future<List<OpenChannel>> loadNext() async {
if (loading) throw QueryInProgressError();
if (!hasNext) return [];
loading = true;
final options = [
if (includeFrozenChannel) ChannelQueryIncludeOption.frozenChannel,
if (includeMetaData) ChannelQueryIncludeOption.metaData
];
final sdk = SendbirdSdk().getInternal();
final res = await sdk.api.send<ChannelListQueryResponse<OpenChannel>>(
OpenChannelListRequest(
channelName: channelName,
channelUrl: channelUrl,
customType: customType,
token: token,
limit: limit,
options: options,
),
);
loading = false;
token = res.next;
hasNext = res.next != '';
return res.channels;
}