StorageModule class
Lightweight storage access module.
Provides secure app-private file I/O, storage diagnostics, and cache management without heavy third-party dependencies.
Constructors
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
-
clearCache(
) → Future< bool> - Clears the app cache directory to free space.
-
deleteFile(
String fileName) → Future< bool> - Deletes a file from app-private storage.
-
fileExists(
String fileName) → Future< bool> - Checks if a file exists in app-private storage.
-
getAppDirectory(
) → Future< String?> - Returns the app-private files directory path.
-
getCacheDirectory(
) → Future< String?> - Returns the app cache directory path.
-
getExternalDirectory(
) → Future< String?> - Returns the external storage directory path (null if unavailable).
-
getStorageInfo(
) → Future< StorageInfo?> - Returns device storage metrics (total, free, cache size, etc.).
-
listFiles(
) → Future< List< FileInfo> > - Lists all files and directories in app-private storage.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readBytes(
String fileName) → Future< Uint8List?> - Reads raw bytes from a file. Returns null if not found.
-
readFile(
String fileName) → Future< String?> - Reads a text file from app-private storage. Returns null if the file does not exist.
-
toString(
) → String -
A string representation of this object.
inherited
-
writeBytes(
String fileName, Uint8List bytes) → Future< String?> - Writes raw bytes to a file in app-private storage.
-
writeFile(
String fileName, String content) → Future< String?> - Writes a text file to app-private storage. Returns the absolute path of the written file.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited