DirectoryBundleFile class
One file of a DIRECTORY inference model (ORT-GenAI): the model is a set of
files that must live together in a per-model subdirectory with their BARE
leaf names (genai_config.json references its siblings by bare name and the
native loader is handed the directory). filename is the EXPLICIT install
identity <modelId>/<bareLeaf> (a real subpath) — NEVER derived from
source, so the on-disk id and the repository key always agree (a
FileSource-derived basename would drop the subdir and break the repo
lookup on every restore). The PRIMARY file (genai_config.json) uses
PreferencesKeys.installedModelFileName as its prefsKey so the
persist-identity + modelFilePaths.values.first both find it; siblings use
their bare leaf name so each maps to a distinct getModelFilePaths entry.
Constructors
- DirectoryBundleFile.member({required String modelId, required String bareName, required String primaryName, required ModelSource source})
-
Builds one bundle member from its
modelId(the subdirectory), its BARE leafbareName, and the bundle'sprimaryName(the file the engine loads from — for ORT-GenAI,genai_config.json). The primary gets PreferencesKeys.installedModelFileName as its key so persist-identity andgetModelFilePaths.values.firstfind it; every sibling keys on its bare name so each maps to a distinct path entry. Used by both the install path and the restore path, so the key rule lives in one place.factory
Properties
- extension → String
-
File extension for validation purposes (with leading dot, e.g., '.model')
no setterinherited
- filename → String
-
Local filename for this file
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isRequired → bool
-
Whether this file is required for the model to function
no setteroverride
- minimumSizeBytes → int?
-
Directory members (
.onnx_data,genai_config.json, tokenizer json/vocab) aren't inFileNameUtils.supportedExtensions, so the extension heuristic would wrongly impose the 1 MB default on small config files. We only assert "a non-empty file landed"; real size/sha verification is a follow-up (ResolvedHfFile.sha256/sizeBytesare carried but not yet checked).no setteroverride - prefsKey → String
-
SharedPreferences key for storing this file's installation status
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → ModelSource
-
Source from which this file can be obtained (NEW: type-safe ModelSource)
no setteroverride
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited