BaseCrudService<M extends Jsonable> class abstract

Base generic crud service that is intented to be used by all other crud services.

Implementers

Constructors

BaseCrudService(PocketBase client)

Properties

baseCrudPath String
The base url path that is used by the service.
no setter
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<M>
Creates a new item.
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.
getFirstListItem(String filter, {String? expand, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) Future<M>
Returns the first found list item by the specified filter.
getFullList({int batch = 500, String? expand, String? filter, String? sort, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) Future<List<M>>
Returns a list with all items batch fetched at once.
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<M>>
Returns paginated items list.
getOne(String id, {String? expand, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) Future<M>
Returns single item by its id.
itemFactoryFunc(Map<String, dynamic> json) → M
The factory function (eg. fromJson()) that will be used to decode the returned items from the crud endpoints.
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<M>
Updates an single item by its id.

Operators

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