LocalStorage class

A Storage implementation that uses the local filesystem.

Implemented types

Constructors

LocalStorage({required String root, String baseUrl = '/storage'})
Creates a new LocalStorage instance.

Properties

baseUrl String
The base URL for serving files stored in this root.
final
hashCode int
The hash code for this object.
no setterinherited
root String
The root directory where files are stored.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String path) Future<void>
Deletes the file at path.
override
exists(String path) Future<bool>
Checks if a file exists at path.
override
get(String path) Future<List<int>>
Retrieves the content of the file at path as bytes.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String path, List<int> bytes) Future<String>
Stores the bytes at the specified path.
override
putFile(String targetPath, String localPath) Future<String>
Stores a file from the localPath at the specified targetPath.
override
toString() String
A string representation of this object.
inherited
url(String path) String
Returns a public URL for the file at path.
override

Operators

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