refreshPaginatedList method

void refreshPaginatedList()

Implementation

void refreshPaginatedList() async {
  _lastDocument = null;
  final localQuery = _getQuery();
  if (isLive) {
    final listener = localQuery
        .snapshots(includeMetadataChanges: includeMetadataChanges)
        .listen((querySnapshot) {
      _emitPaginatedState(querySnapshot.docs);
    });

    _streams.add(listener);
  } else {
    final querySnapshot = await localQuery.get(options);
    _emitPaginatedState(querySnapshot.docs);
  }
}