QuerySnapshot<T extends Model> constructor

QuerySnapshot<T extends Model>({
  1. required List<T> items,
  2. required bool isSynced,
  3. QueryPredicate<Model>? where,
  4. List<QuerySortBy>? sortBy,
})

A snapshot consisting of the items in the local store when the snapshot was generated and a boolean value to indicate if this model has finished syncing data over the network.

Implementation

factory QuerySnapshot({
  required List<T> items,
  required bool isSynced,
  QueryPredicate? where,
  List<QuerySortBy>? sortBy,
}) {
  final sortedList = SortedList.fromPresortedList(
    items: items,
    compare: _createCompareFromSortBy(sortBy),
  );
  return QuerySnapshot._(
    sortedList: sortedList,
    isSynced: isSynced,
    where: where,
    sortBy: sortBy,
  );
}