getWholeCollection method

  1. @override
Future<Result<int, String, List<T>>> getWholeCollection({
  1. List<DataFilter>? subCollectionQuery,
  2. int limit = 1000,
  3. String channel = 'main',
  4. CrudStrategy strategy = const DefaultCrudStrategy(),
})
override

Implementation

@override
Future<Result<int, String, List<T>>> getWholeCollection({
  List<DataFilter>? subCollectionQuery,
  int limit = 1000,
  String channel = 'main',
  CrudStrategy strategy = const DefaultCrudStrategy(),
}) async {
  final res = await _crud.getWholeCollection(
    currentCount: _currentList(channel).length,
    subCollectionQuery: subCollectionQuery,
    limit: limit,
  );
  if (res.code == 0) {
    final items = res.data!;
    _getItemsStream(channel).add(items);
    return res;
  } else {
    final items = _currentList(channel);
    _getItemsStream(channel).add(items);
    return _listResult(items);
  }
}