BundledSourceHandler class
Handles installation of models from native bundled resources
Features:
- Uses platform-specific native resource paths
- Android: assets/models/{resourceName}
- iOS: Bundle.main.path(forResource:)
- Web: /assets/{resourceName}
- No copying required (uses native path directly)
- Single-step progress (resources already available)
NOTE on targetFilename: a bundled resource is compiled into the app at
a fixed BundledSource.resourceName — this handler cannot rename the
physical asset at runtime. targetFilename only namespaces the
repository identity key (ModelInfo.id); it does not affect
getBundledResourcePath. Bundled companions are not among today's
exposed collisions (network installs are); this closes the repository-key
ambiguity for future bundled companions without claiming to fix an
on-disk collision this handler structurally cannot fix.
- Implemented types
Constructors
- BundledSourceHandler({required FileSystemService fileSystem, required ModelRepository repository})
Properties
- fileSystem → FileSystemService
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- repository → ModelRepository
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
install(
ModelSource source, {CancelToken? cancelToken, String? targetFilename}) → Future< void> -
Installs the model from the given source
override
-
installWithProgress(
ModelSource source, {CancelToken? cancelToken, String? targetFilename}) → Stream< int> -
Installs the model with progress tracking
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
supports(
ModelSource source) → bool -
Checks if this handler supports the given source type
override
-
supportsResume(
ModelSource source) → bool -
Checks if this source supports resume after interruption
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited