query<T extends Model> method

Future<List<T>> query<T extends Model>(
  1. ModelType<T> modelType, {
  2. QueryPredicate<Model>? where,
  3. QueryPagination? pagination,
  4. List<QuerySortBy>? sortBy,
})

Query the DataStore to find all items of the specified modelType that satisfy the specified query predicate where.

Returned items are paginated by pagination and sorted by sortBy.

Implementation

Future<List<T>> query<T extends Model>(ModelType<T> modelType,
    {QueryPredicate? where,
    QueryPagination? pagination,
    List<QuerySortBy>? sortBy}) {
  return plugins.length == 1
      ? plugins[0].query(modelType,
          where: where, pagination: pagination, sortBy: sortBy)
      : throw _pluginNotAddedException('DataStore');
}