ModelSource class sealed
Sealed class representing all possible model sources Provides type-safe alternative to string URLs
- Implementers
Constructors
- ModelSource.asset(String path)
-
Creates an asset-based source (Flutter assets)
factory
- ModelSource.bundled(String resourceName)
-
Creates a bundled resource source (native resources)
factory
- ModelSource.file(String path)
-
Creates a file-based source (external files, mobile only)
factory
- ModelSource.network(String url, {String? authToken, bool? foreground})
-
Creates a network-based source (HTTPS/HTTP)
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- requiresDownload → bool
-
Whether this source requires downloading
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsProgress → bool
-
Whether this source supports progress tracking
no setter
- supportsResume → bool
-
Whether this source supports resume after interruption
no setter
Methods
-
encode(
) → String -
Compact string representation for SharedPreferences-based active-model
persistence (#227). Format:
<kind>|<value>where kind ∈ {network,asset,bundled,file}. Auth tokens are NOT encoded — restored network sources will re-request without auth and let the file system service serve the previously-cached blob instead of re-downloading. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateLoraSource(
ModelSource loraSource) → bool - Validates if LoRA source is compatible with this model source
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
tryDecode(
String? encoded) → ModelSource? - Decode the string produced by encode. Returns null if the input is malformed or names an unknown kind (forward-compat).