PocketBase class
The main PocketBase API client.
Constructors
- PocketBase.new(String baseURL, {String lang = "en-US", AuthStore? authStore, bool reuseHTTPClient = false, Client httpClientFactory()?})
Properties
- admins → RecordService
-
no setter
- authStore ↔ AuthStore
-
An instance of the local AuthStore service.
latefinal
- backups ↔ BackupService
-
The service that handles the Backup and restore APIs.
latefinal
- baseURL ↔ String
-
The PocketBase backend base url address (eg. 'http://127.0.0.1:8090').
getter/setter pair
- baseUrl ↔ String
-
getter/setter pair
- collections ↔ CollectionService
-
An instance of the service that handles the Collection APIs.
latefinal
- crons ↔ CronService
-
The service that handles the Cron APIs.
latefinal
- files ↔ FileService
-
An instance of the service that handles the File APIs.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- health ↔ HealthService
-
An instance of the service that handles the Health APIs.
latefinal
- httpClientFactory ↔ Client Function()
-
The underlying http client that will be used to send the request.
This is used primarily for the unit tests.
latefinal
- lang ↔ String
-
Optional language code (default to
en-US
) that will be sent with the requests to the server asAccept-Language
header.getter/setter pair - logs ↔ LogService
-
An instance of the service that handles the Log APIs.
latefinal
- realtime ↔ RealtimeService
-
An instance of the service that handles the Realtime APIs.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings ↔ SettingsService
-
An instance of the service that handles the Settings APIs.
latefinal
Methods
-
buildUrl(
String path, [Map< String, dynamic> queryParameters = const {}]) → Uri -
buildURL(
String path, [Map< String, dynamic> queryParameters = const {}]) → Uri - Builds and returns a full request url by safely concatenating the provided path to the base url.
-
close(
) → void -
Note: this method needs to be called only when the PocketBase
client instance is created with the
reuseHTTPClient
option. -
collection(
String collectionIdOrName) → RecordService - Returns the RecordService associated to the specified collection.
-
createBatch(
) → BatchService - Creates a new batch handler for sending multiple transactional create/update/upsert/delete collection requests in one network call.
-
filter(
String expr, [Map< String, dynamic> query = const {}]) → String - Constructs a filter expression with placeholders populated from a map.
-
getFileUrl(
RecordModel record, String filename, {String? thumb, String? token, Map< String, dynamic> query = const {}}) → Uri -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send<
T extends dynamic> (String path, {String method = "GET", Map< String, String> headers = const {}, Map<String, dynamic> query = const {}, Map<String, dynamic> body = const {}, List<MultipartFile> files = const []}) → Future<T> - Sends a single HTTP request built with the current client configuration and the provided options.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited