Storage class

Handles file storage operations for uploaded files in Flint Dart.

This class provides static helper methods to:

  • Save uploaded files to a public directory
  • Delete files by their public URL
  • Replace existing files with new ones

Files are stored in the public/uploads directory by default and accessed via the /uploads URL path.

Example:

final fileUrl = await Storage.create(uploadedFile);
await Storage.delete(fileUrl);
final newFileUrl = await Storage.update(fileUrl, newUploadedFile);

Constructors

Storage.new()

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 Methods

create(UploadedFile file, {String subdirectory = ''}) Future<String>
Saves an uploaded file to the server.
delete(String fileUrl) Future<void>
Deletes a file from the server using its public URL.
update(String oldFileUrl, UploadedFile newFile, {String subdirectory = ''}) Future<String>
Replaces an old file with a new uploaded file.