Model and delegate shared by every task's options, in every family.
Supply exactly one model source: a pinned official model, a modelPath
or owned modelBytes. A task's create resolves a pinned model to the
app's bundled copy (or a download when ModelStore.allowDownloads is
true), checks it against its SHA-256, and only then opens Google's
runtime. The public values never change after construction.
Constructors
-
TaskOptions({DownloadAsset? model, String? modelPath, Uint8List? modelBytes, Delegate delegate = Delegate.cpu, required String family, required Map<
String, DownloadAsset> registry}) -
Checks the model source and
delegateonce, the same way on every platform.familyandregistry(the family'sXxxModels.byName) let an error for a model the app does not bundle name the pubspec entry.
Properties
- delegate → Delegate
-
The processor the task runs on, fixed until it is disposed.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- model → DownloadAsset?
-
Pinned official model: the app's bundled copy, or a download when
ModelStore.allowDownloadsis true. Verified against its SHA-256.final - modelBytes → Uint8List?
-
Owned, read-only model bytes. Null when the model is a file.
no setter
- modelPath → String?
-
The model's location, as Google's APIs read it: a file on native
platforms and a URL, resolved against the page, in browsers. Null when
the model is in memory.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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