list method

  1. @override
Future<ChatResult<ChatPaginatedResponse<ChatContact>>> list({
  1. ChatPaginationParams? pagination,
  2. CachePolicy? cachePolicy,
})
override

Lists the current user's contacts.

Drives the contacts tab and the new-DM picker. cachePolicy defaults to networkFirst; the UI adapter passes cacheFirst for fast paint and re-issues networkOnly on pull-to-refresh. The returned ChatContact carries the contact's user id + display metadata; pair with getPresence for the online dot.

Implementation

@override
Future<ChatResult<ChatPaginatedResponse<ChatContact>>> list({
  ChatPaginationParams? pagination,
  CachePolicy? cachePolicy,
}) async {
  final contacts = _client._contacts
      .map((id) => ChatContact(userId: id))
      .toList();
  return ChatSuccess(ChatPaginatedResponse(items: contacts, hasMore: false));
}