PocketBase class

The main PocketBase API client.

Constructors

PocketBase(String baseUrl, {String lang = "en-US", AuthStore? authStore, Client httpClientFactory()?})

Properties

admins AdminService
An instance of the service that handles the Admin APIs.
latefinal
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
collections CollectionService
An instance of the service that handles the Collection 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 as Accept-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
Builds and returns a full request url by safely concatenating the provided path to the base url.
collection(String collectionIdOrName) RecordService
Returns the RecordService associated to the specified collection.
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
Legacy alias of pb.files.getUrl().
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(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
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