Abstraction for file system operations Allows different implementations for different platforms (mobile/web) and easy mocking in tests
Platform implementations:
- PlatformFileSystemService: uses dart:io for mobile
- WebFileSystemService: uses IndexedDB/LocalStorage for web
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
-
adoptLegacyFile(
String oldFilename, String newFilename) → Future< bool> -
Migration-only (install-identity-namespacing, 2026-08-02): if a file
already exists on disk under
oldFilename(the pre-refactor flat name) and nothing exists yet undernewFilename(the namespaced identity), renames it in place and returns true — the caller should treat this as "already installed" and persist repository metadata undernewFilenameinstead of re-downloading. Returns false when there is nothing to adopt: no old file,newFilenamealready exists, oroldFilename == newFilename(nothing changed identity, so there is nothing to migrate). -
deleteFile(
String path) → Future< void> - Deletes a file at the given path
-
fileExists(
String path) → Future< bool> - Checks if a file exists at the given path
-
getBundledResourcePath(
String resourceName) → Future< String> - Gets the path to a bundled native resource
-
getFileSize(
String path) → Future< int> - Gets the size of a file in bytes
-
getModelStorageDirectory(
) → Future< String> - Returns the canonical directory where model files are stored.
-
getReadTargetPath(
String filename) → Future< String> - Gets the path for reading a model file with given filename.
-
getTargetPath(
String filename) → Future< String> - Deprecated. Use getReadTargetPath for reads or getWriteTargetPath for writes to route paths correctly.
-
getWriteTargetPath(
String filename) → Future< String> - Gets the target path for storing a model file with given filename.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readFile(
String path) → Future< Uint8List> - Reads data from a file at the given path
-
registerExternalFile(
String filename, String externalPath) → Future< void> - Registers an external file path (for FileSource)
-
toString(
) → String -
A string representation of this object.
inherited
-
writeFile(
String path, Uint8List data) → Future< void> - Writes data to a file at the given path
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited