WebBundledSourceHandler class

Handles installation of models from native bundled resources (WEB PLATFORM)

On web, bundled resources are served by the web server at paths like:

  • assets/models/gemma.task
  • assets/models/lora-weights.bin

This handler:

  1. Constructs the bundled resource URL path
  2. Registers the URL with WebFileSystemService
  3. Saves metadata to ModelRepository
  4. MediaPipe loads directly from the URL (no file copy)

Features:

  • No file copying (web has no local file system)
  • Direct URL registration for MediaPipe
  • Simulated progress for UX consistency
  • Instant "installation" (resources already bundled)

Platform: Web only

Implemented types

Constructors

WebBundledSourceHandler({required WebFileSystemService fileSystem, required ModelRepository repository, required WebCacheService cacheService, required WebJsInterop jsInterop})

Properties

cacheService → WebCacheService
final
fileSystem → WebFileSystemService
final
hashCode → int
The hash code for this object.
no setterinherited
jsInterop → WebJsInterop
final
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