CollectionService class
The service that handles the Collection APIs.
Usually shouldn't be initialized manually and instead PocketBase.collections should be used.
- Inheritance
-
- Object
- BaseCrudService<
CollectionModel> - CollectionService
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
-
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 = 500, 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
-
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
-
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