SttInstallationBuilder class

Fluent builder for STT (speech-to-text) model installation

Provides type-safe API for installing STT models (requires model + tokenizer). Automatically sets the installed model as the active STT model.

The model is SELECTABLE like inference models: ofType is required so the installed SttModelSpec carries an SttModelType (mirrors InferenceModelSpec.modelType) — a single generic backend can then dispatch to the right runtime profile instead of hardcoding one model.

Usage:

await FlutterEdgeAi.installStt()
  .modelFromNetwork('https://example.com/model.tflite', token: 'hf_...')
  .tokenizerFromNetwork('https://example.com/tokenizer.json', token: 'hf_...')
  .ofType(SttModelType.moonshine)
  .withModelProgress((p) => print('Model: $p%'))
  .withTokenizerProgress((p) => print('Tokenizer: $p%'))
  .install();

Constructors

SttInstallationBuilder()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

install() → Future<SttInstallation>
Execute the installation and automatically set as active STT model
modelFromAsset(String path) → SttInstallationBuilder
Set model source from Flutter asset
modelFromBundled(String resourceName) → SttInstallationBuilder
Set model source from bundled native resource
modelFromFile(String path) → SttInstallationBuilder
Set model source from external file path
modelFromNetwork(String url, {String? token}) → SttInstallationBuilder
Set model source from network URL (HTTP/HTTPS)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ofType(SttModelType sttModelType) → SttInstallationBuilder
Set the STT model family (SttModelType) this install represents.
tokenizerFromAsset(String path) → SttInstallationBuilder
Set tokenizer source from a Flutter asset.
tokenizerFromBundled(String resourceName) → SttInstallationBuilder
Set tokenizer source from a bundled native resource.
tokenizerFromFile(String path) → SttInstallationBuilder
Set tokenizer source from an external file path.
tokenizerFromNetwork(String url, {String? token}) → SttInstallationBuilder
Set tokenizer source from network URL (HTTP/HTTPS).
toString() → String
A string representation of this object.
inherited
withCancelToken(CancelToken cancelToken) → SttInstallationBuilder
Set cancellation token for this installation
withModelProgress(void onProgress(int progress)) → SttInstallationBuilder
Add model file progress callback
withTokenizerProgress(void onProgress(int progress)) → SttInstallationBuilder
Add tokenizer file progress callback

Operators

operator ==(Object other) → bool
The equality operator.
inherited