AssetSourceHandler class

Handles installation of models from Flutter assets

Features:

  • Loads assets using AssetLoader (supports web and mobile)
  • Copies asset data to app documents directory
  • Normalizes asset paths (handles assets/ prefix automatically)
  • Single-step progress (no chunked loading for assets)
Implemented types

Constructors

AssetSourceHandler({required AssetLoader assetLoader, required FileSystemService fileSystem, required ModelRepository repository})

Properties

assetLoader → AssetLoader
final
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, ModelType modelType = ModelType.inference}) → Future<void>
Installs the model from the given source
override
installWithProgress(ModelSource source, {CancelToken? cancelToken, String? targetFilename, ModelType modelType = ModelType.inference}) → 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