CollectionService class

The service that handles the Collection APIs.

Usually shouldn't be initialized manually and instead PocketBase.collections should be used.

Inheritance

Constructors

CollectionService(PocketBase client)

Properties

baseCrudPath → String
The base url path that is used by the service.
no setteroverride
client → PocketBase
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

create({Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, List<MultipartFile> files = const [], Map<String, String> headers = const {}, String? expand, String? fields}) → Future<CollectionModel>
Creates a new item.
inherited
delete(String id, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Deletes an single item by its id.
inherited
dryRunViewQuery(String viewQuery, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<List<RecordModel>>
Executes the specified view query and returns a sample of the resulting records.
getAllOAuth2Providers({Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<List<ConfigurableOAuth2Provider>>
Returns a list with all configurable OAuth2 providers.
getFirstListItem(String filter, {String? expand, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<CollectionModel>
Returns the first found list item by the specified filter.
inherited
getFullList({int batch = 1000, String? expand, String? filter, String? sort, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<List<CollectionModel>>
Returns a list with all items batch fetched at once.
inherited
getList({int page = 1, int perPage = 30, bool skipTotal = false, String? expand, String? filter, String? sort, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<ResultList<CollectionModel>>
Returns paginated items list.
inherited
getOne(String id, {String? expand, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<CollectionModel>
Returns single item by its id.
inherited
getScaffolds({Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<Map<String, CollectionModel>>
Returns type indexed map with scaffolded collection models populated with their default field values.
import(List<CollectionModel> collections, {bool deleteMissing = false, Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Imports the provided collections.
itemFactoryFunc(Map<String, dynamic> json) → CollectionModel
The factory function (eg. fromJson()) that will be used to decode the returned items from the crud endpoints.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
truncate(String collectionIdOrName, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Deletes all records associated with the specified collection.
update(String id, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, List<MultipartFile> files = const [], Map<String, String> headers = const {}, String? expand, String? fields}) → Future<CollectionModel>
Updates an single item by its id.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited