$FileService class

File service with offline caching of downloaded file bytes.

One instance exists per $PocketBase client, so concurrent requests for the same file share a single download.

Inheritance

Constructors

$FileService($PocketBase client)

Properties

client → $PocketBase
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

getFileBytes({required String recordId, required String recordCollectionName, required String filename, String? thumb, String? token, bool autoGenerateToken = false, RequestPolicy requestPolicy = RequestPolicy.cacheAndNetwork, Duration? expireAfter, Duration timeout = const Duration(seconds: 30)}) → Future<Uint8List>
Gets file data, respecting the specified RequestPolicy.
getToken({Map<String, dynamic> body = const {}, Map<String, dynamic> query = const {}, Map<String, String> headers = const {}}) → Future<String>
Requests a new private file access token for the current auth model.
inherited
getURL(RecordModel record, String filename, {String? thumb, String? token, bool? download, Map<String, dynamic> query = const {}}) → Uri
Builds and returns an absolute record file url.
inherited
getUrl(RecordModel record, String filename, {String? thumb, String? token, bool? download, Map<String, dynamic> query = const {}}) → Uri
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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