RecordService class

The service that handles the Record APIs.

Usually shouldn't be initialized manually and instead PocketBase.collection("COLLECTION") should be used.

Inheritance

Constructors

RecordService(PocketBase client, String _collectionIdOrName)

Properties

baseCollectionPath → String
Returns the current collection service base path.
no setter
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

authRefresh({String? expand, String? fields, Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<RecordAuth>
Refreshes the current authenticated auth record instance and returns a new token and record data.
authWithOAuth2(String providerName, OAuth2URLCallbackFunc urlCallback, {List<String> scopes = const [], Map<String, dynamic> createData = const {}, Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}, String? expand, String? fields}) → Future<RecordAuth>
Authenticate a single auth collection record with OAuth2 without custom redirects, deeplinks or even page reload.
authWithOAuth2Code(String provider, String code, String codeVerifier, String redirectURL, {Map<String, dynamic> createData = const {}, Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}, String? expand, String? fields}) → Future<RecordAuth>
Authenticate an auth record with an OAuth2 client provider and returns a new auth token and record data (including the OAuth2 user profile).
authWithOTP(String otpId, String password, {String? expand, String? fields, Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<RecordAuth>
Authenticate an auth record via OTP.
authWithPassword(String usernameOrEmail, String password, {String? expand, String? fields, Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<RecordAuth>
Authenticate an auth record by its username/email and password and returns a new auth token and record data.
confirmEmailChange(String emailChangeToken, String userPassword, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Confirms auth record new email address.
confirmPasswordReset(String passwordResetToken, String password, String passwordConfirm, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Confirms auth record password reset request.
confirmVerification(String verificationToken, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Confirms auth record email verification request.
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<RecordModel>
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 a single record model by its id.
override
getFirstListItem(String filter, {String? expand, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<RecordModel>
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<RecordModel>>
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<RecordModel>>
Returns paginated items list.
inherited
getOne(String id, {String? expand, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<RecordModel>
Returns single item by its id.
inherited
impersonate(String recordId, num duration, {String? expand, String? fields, Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<PocketBase>
Impersonate authenticates with the specified recordId and returns a new client with the received auth token in a memory store.
itemFactoryFunc(Map<String, dynamic> json) → RecordModel
The factory function (eg. fromJson()) that will be used to decode the returned items from the crud endpoints.
override
listAuthMethods({String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<AuthMethodsList>
Returns all available application auth methods.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestEmailChange(String newEmail, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Sends auth record email change request to the provided email.
requestOTP(String email, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<OTPResponse>
Sends auth record OTP request to the provided email.
requestPasswordReset(String email, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Sends auth record password reset request.
requestVerification(String email, {Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<void>
Sends auth record verification email request.
subscribe(String topic, RecordSubscriptionFunc callback, {String? expand, String? filter, String? fields, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<UnsubscribeFunc>
Subscribe to realtime changes to the specified topic ("*" or record id).
toString() → String
A string representation of this object.
inherited
unsubscribe([String topic = ""]) → Future<void>
Unsubscribe from all subscriptions of the specified topic ("*" or record id).
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<RecordModel>
Updates a single record model by its id.
override

Operators

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