MethodChannelOnDeviceAi class

An implementation of OnDeviceAiPlatform that uses method channels.

Inheritance

Constructors

MethodChannelOnDeviceAi()

Properties

eventChannel EventChannel
final
hashCode int
The hash code for this object.
no setterinherited
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
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.
override
loadModel(String modelName, {ModelConfig? config}) Future<void>
Loads the specified model and prepares it for inference.
override
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.
override
runText(String prompt) Future<AIResult>
Runs text inference on the loaded model and returns the result.
override
streamText(String prompt) Stream<String>
Streams generated text tokens from a generative model.
override
toString() String
A string representation of this object.
inherited

Operators

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