StorageClient class
Client for storage operations
Constructors
-
StorageClient({required String baseUrl, required TokenStorage tokenStorage, Client? httpClient, Duration timeout = const Duration(seconds: 30), Map<
String, String> ? headers}) - Creates a new StorageClient instance
Properties
- baseUrl → String
-
Base URL of the storage service
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration
-
Request timeout duration
final
- tokenStorage → TokenStorage
-
Token storage
final
Methods
-
delete(
String fileId) → Future< void> - Deletes a file
-
download(
String fileId) → Future< Uint8List> - Downloads a file
-
getMetadata(
String fileId) → Future< FileInfo> - Gets file metadata
-
getSignedUrl(
String fileId, {int expirySeconds = 3600}) → Future< String> - Generates a signed URL for a file
-
getStats(
) → Future< Map< String, dynamic> > - Gets storage statistics
-
list(
{String? bucket, int limit = 50, int skip = 0}) → Future< List< FileInfo> > - Lists files
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
upload(
Uint8List bytes, String filename, {String? mimeType, String? bucket, bool isPublic = false, Map< String, dynamic> ? metadata}) → Future<FileInfo> - Uploads a file
-
uploadBase64(
String base64Data, String filename, {String mimeType = 'application/octet-stream', String? bucket, bool isPublic = false, Map< String, dynamic> ? metadata}) → Future<FileInfo> - Uploads a file from base64
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited