Files
meshcore-open/stubs/flutter_onnxruntime/lib/flutter_onnxruntime.dart
T
tthandClaude Opus 5.5 42e4a1e0de Build without on-device ML, arm64 only
Replace llamadart, flutter_onnxruntime and flutter_langdetect with
API-compatible stubs via dependency_overrides, so llama.cpp, LiteRT-LM
and ONNX Runtime are not packaged. Translation and the neural image
codec become unavailable; both are off by default upstream.

Also drop non-arm64 prebuilt plugin libraries at packaging time.
APK: 340 MB -> 39.5 MB, flutter test 909/909 passing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:59:53 +02:00

35 lines
785 B
Dart

Never _unsupported() =>
throw UnsupportedError('ONNX Runtime is not built in.');
class OnnxRuntime {
Future<OrtSession> createSession(String path, {Object? options}) async =>
_unsupported();
}
class OrtSession {
OrtSession._();
List<String> get inputNames => const <String>[];
List<String> get outputNames => const <String>[];
Future<Map<String, OrtValue>> run(
Map<String, OrtValue> inputs, {
Object? options,
}) async => _unsupported();
Future<void> close() async {}
}
class OrtValue {
OrtValue._();
static Future<OrtValue> fromList(Object data, List<int> shape) async =>
_unsupported();
List<int> get shape => const <int>[];
Future<List<dynamic>> asFlattenedList() async => _unsupported();
Future<void> dispose() async {}
}