fetch method

  1. @override
Future<Iterable<Conversation>> fetch({
  1. int? limit,
  2. int? skip,
})
override

Implementation

@override
Future<Iterable<Conversation>> fetch({
  int? limit,
  int? skip,
}) async {
  if (skip == null || limit == null) return [];
  var ids = _conversationIds!.skip(skip).take(limit);

  var futures = <Future<Conversation?>>[];
  for (var id in ids) {
    var future = _loadConversation(id);
    futures.add(future);
  }

  List<Conversation?> conversations = await Future.wait(futures);

  return conversations.whereType<Conversation>();
}