executorch_dart_shared library

The dart:ffi-free subset of package:executorch_dart.

Application code should not import this library — import package:executorch_dart/executorch_dart.dart instead. This one exists for a single consumer: the web branch of package:executorch_flutter.

The reason it has to exist is that export '...' hide Name still compiles the library it hides names from. executorch_flutter re-exports this package wholesale and routes the handful of native-only names to web implementations of its own, but hiding those names is not enough — on web, the blanket re-export would still drag executorch_dart.dart, and with it dart:ffi, into the dart2js compile and fail the build. Pointing the web branch of that re-export here keeps dart:ffi out of the graph entirely.

So this library carries everything in the package that does not need dart:ffi: the tensor and model types, the error hierarchy, the processor base classes, the manager interface and its shared base implementation, and the version constant. The four native-only pieces — ExecuTorchLLM, BackendQuery, ExecuTorchVersion, and setNativeDebugLogging — are exported only from executorch_dart.dart.

When adding a new export to this package, add it here unless it needs dart:ffi; executorch_dart.dart re-exports this library in full.

Classes

ExecutorchManager
High-level manager for ExecuTorch inference operations
ExecutorchManagerBase
Base implementation of ExecutorchManager with shared logic
ExecuTorchModel
High-level wrapper for an ExecuTorch model instance
ExecuTorchPostprocessor<R>
Abstract base class for output postprocessing
ExecuTorchPreprocessor<T>
Abstract base class for input preprocessing
ExecuTorchProcessor<T, R>
Abstract base class combining preprocessing and postprocessing
GenConfig
Generation parameters for ExecuTorchLLM.generate.
ModelLoadResult
Model loading result.
ProcessorTensorUtils
Utility class for tensor operations in processors
TensorData
Tensor data for input/output.
TensorUtils
Utility class for working with ExecuTorch tensors

Enums

Backend
Hardware acceleration backends supported by ExecuTorch.
TensorType
Tensor data type enumeration.

Extensions

TensorTypeExtension on TensorType
Deprecated extension providing backward compatibility for ExtendedTensorType.

Constants

executorchVersion → const String
ExecuTorch version this plugin is built against.

Typedefs

ExtendedTensorType = TensorType
Deprecated alias for TensorType.

Exceptions / Errors

ExecuTorchException
Base exception class for all ExecuTorch-related errors.
ExecuTorchInferenceException
Inference execution errors.
ExecuTorchIOException
Network and file I/O errors.
ExecuTorchMemoryException
Memory and resource errors.
ExecuTorchModelException
Model loading and lifecycle errors.
ExecuTorchPlatformException
Platform-specific integration errors.
ExecuTorchValidationException
Tensor validation and data errors.
GenericProcessorException
Generic processor exception implementation.
InvalidInputException
Exception thrown for invalid processor input.
InvalidOutputException
Exception thrown for invalid processor output.
PostprocessingException
Exception thrown during postprocessing operations.
PreprocessingException
Exception thrown during preprocessing operations.
ProcessorException
Base exception class for processor-related errors.