OnDeviceAiPlatform class abstract

The platform interface for the on_device_ai plugin.

Platform-specific implementations of this plugin must extend this class rather than implement it directly, as new methods may be added over time and extending ensures backward compatibility.

The default implementation is MethodChannelOnDeviceAi.

Inheritance
  • Object
  • PlatformInterface
  • OnDeviceAiPlatform
Implementers

Constructors

OnDeviceAiPlatform()
Constructs an OnDeviceAiPlatform.

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

dispose() Future<void>
Releases native resources held by the currently loaded model.
loadModel(String modelName, {ModelConfig? config}) Future<void>
Loads the specified model and prepares it for inference.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runImage(Uint8List imageBytes) Future<AIResult>
Runs image classification on the loaded model and returns the result.
runText(String prompt) Future<AIResult>
Runs text inference on the loaded model and returns the result.
streamText(String prompt) Stream<String>
Streams generated text tokens from a generative model.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance OnDeviceAiPlatform
The default instance of OnDeviceAiPlatform to use.
getter/setter pair