ModelDownloader class

Utility for downloading, managing, and verifying the neural ASR model asset on demand, avoiding the need to bundle ~69MB into the initial app binary. Tokens and phonemes remain bundled inside the app assets for offline stability.

Constructors

ModelDownloader({String modelUrl = defaultModelUrl, String? customStoragePath})

Properties

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

Methods

deleteAssets() → Future<void>
Deletes downloaded model files from disk to free storage.
downloadAssets({void onProgress(double progress, String status)?, bool isCancelled()?, Client? client}) → Future<bool>
Downloads the neural model asset with streaming progress reporting.
getModelDirectoryPath() → Future<String>
Returns the absolute path to the directory containing model assets.
getModelFilePath() → Future<String>
Returns the absolute path to the downloaded model file.
getStorageDirectory() → Future<Directory>
Resolves the destination directory for on-demand recitation assets.
isModelReady() → Future<bool>
Verifies whether the neural model file exists on disk and meets the size threshold.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

defaultModelFileName → const String
defaultModelUrl → const String