FileStorage class abstract interface

Constructors

FileStorage()
Creates a platform specific instance of the FileStorage.
factory

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

ensurePathExists(String fileName) Future<void>
Checks recursively that all folders on the fileName's path exist, if any folder doesn't exist, it will be created.
fileExists(String fileName) Future<bool>
Checks whether the file with specified fileName exists.
getCachePath({String? path, String? profile, bool create = false}) Future<String>
Returns the path to application's cache in the local storage.
getDocumentsPath({String? path, String? profile, bool create = false}) Future<String>
Returns the path to application's documents in the local storage.
getFilesPath({String? path, String? profile, bool create = false}) Future<String>
Returns the path to application's file in the local storage.
listFiles(FileStorageArea area, {String? path, String? profile, bool recursive = true}) Future<List<FileStorageEntry>>
Lists stored files relative to the area root.
loadData(String fileName) Future<List<int>?>
Loads the data from the file fileName.
loadJson(String fileName) Future<Object?>
Reads the json encoded in UTF-8 from the file fileName.
loadText(String fileName) Future<String?>
Reads the text encoded in UTF-8 from the file fileName.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeFile(String fileName) Future<void>
Removes the file with the name fileName if exists.
saveData(String fileName, List<int> data) Future<void>
Saves the data to the file fileName.
saveJson(String fileName, dynamic jsonValue, {Object? toEncodable(dynamic)?}) Future<void>
Saves the jsonValue to the file fileName.
saveStream(String fileName, Stream<List<int>> stream) Future<void>
Saves the stream to the file fileName.
saveText(String fileName, String text) Future<void>
Saves the text to the file fileName.
toString() String
A string representation of this object.
inherited

Operators

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