WebFileSystemService class

Web implementation of FileSystemService using URL-based storage

This implementation doesn't actually store files locally (web has no local file system). Instead, it maintains a registry of URLs that MediaPipe can fetch directly.

Features:

  • URL registry for model paths (in-memory)
  • No actual file downloads (MediaPipe fetches URLs directly)
  • Asset path resolution for web
  • Memory-efficient (stores URLs, not file data)

Platform: Web only

Implemented types

Constructors

WebFileSystemService.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

clearAllUrls() → void
Clears all URL mappings (web-specific extension)
deleteFile(String path) Future<void>
Deletes a file at the given path
override
fileExists(String path) Future<bool>
Checks if a file exists at the given path
override
getAllUrls() Map<String, String>
Gets all registered URLs (web-specific extension)
getBundledResourcePath(String resourceName) Future<String>
Gets the path to a bundled native resource
override
getFileSize(String path) Future<int>
Gets the size of a file in bytes
override
getTargetPath(String filename) Future<String>
Gets the target path for storing a model file with given filename
override
getUrl(String filename) String?
Gets the URL for a registered model (web-specific extension)
isBlobUrl(String url) bool
Checks if a URL is a blob URL
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
override
registerExternalFile(String filename, String externalPath) Future<void>
Registers an external file path (for FileSource)
override
registerUrl(String filename, String url) → void
Registers a URL for a model (web-specific extension)
setOnBlobUrlRemoved(void callback(String blobUrl)) → void
toString() String
A string representation of this object.
inherited
unregisterUrl(String filename) → void
Removes a URL registration and notifies cleanup managers.
writeFile(String path, Uint8List data) Future<void>
Writes data to a file at the given path
override

Operators

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