HelperUtils class abstract final

This class contains static helper functions that do not rely on the pocketbase instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Properties

preCreationHook HelperHook
Register hook to modify the json that gets sent to the pocketbase server instance on creation
getter/setter pair
preUpdateHook HelperHook
Register hook to modify the json that gets sent to the pocketbase server instance on updates
getter/setter pair

Static Methods

buildExpansionString(Map<String, String>? expansions) String?
Converts an expansion map into a single string formatted for the expand field in the pocketbase sdk.
buildFileUrl(String collection, String recordId, String fileName, {PocketBase? pocketBaseInstance, Map<String, dynamic> queryParameters = const {}}) Uri
Build the access url to a file.
buildQuery(List<String> keywords, List<String> searchableFields, {List<String>? otherFilters, Map<String, dynamic>? otherParams}) → (String, Map<String, dynamic>)
Compose an advanced query string with paramaters, to do keyword searching on a collection This function takes the following fields:
buildSortString({String? sortField, bool ascending = true}) String?
Build a sort string from a given field and ascending boolean property.
cleanMap(Map<String, dynamic> map) Map<String, dynamic>
Pocketbase does returns strings instead of null for fields like:
getNameFromUrl(String url) String
Get the name of a file from their absolute url path, this is simply the last segment of the path.
getNamesFromUrls(List<String> fileUrls) List<String>
Gets the names of files from their urls.
getRecordJson(RecordModel record, [Map<String, String>? expansions]) Map<String, dynamic>
Get a formatted json from a pocketbase record
mergeExpansions(Map<String, String>? expansions, Map<String, dynamic> map) Map<String, dynamic>
Merges the expansion field directly into the map, renaming according to expansions For example:
pathsToFiles(List<String> paths) Future<Map<String, Uint8List>>
Convert filepaths into a correctly formatted filemap that is required by the addFiles method This method does not work for Web and WILL throw an error.
pathToFile(String path) Future<(String, Uint8List)>
Convert a file path into file name and data. This method does not work for Web and WILL throw an error.