Use xcframework for Flutter iOS plugin. (#1547)
This commit is contained in:
@@ -25,7 +25,7 @@ String? _path;
|
||||
// https://github.com/flutter/codelabs/blob/main/ffigen_codelab/step_05/lib/ffigen_app.dart
|
||||
// https://api.flutter.dev/flutter/dart-io/Platform-class.html
|
||||
final DynamicLibrary _dylib = () {
|
||||
if (Platform.isMacOS || Platform.isIOS) {
|
||||
if (Platform.isMacOS) {
|
||||
if (_path == null) {
|
||||
return DynamicLibrary.open('libsherpa-onnx-c-api.dylib');
|
||||
} else {
|
||||
@@ -33,6 +33,14 @@ final DynamicLibrary _dylib = () {
|
||||
}
|
||||
}
|
||||
|
||||
if (Platform.isIOS) {
|
||||
if (_path == null) {
|
||||
return DynamicLibrary.open('sherpa_onnx.framework/sherpa_onnx');
|
||||
} else {
|
||||
return DynamicLibrary.open('$_path/sherpa_onnx.framework/sherpa_onnx');
|
||||
}
|
||||
}
|
||||
|
||||
if (Platform.isAndroid || Platform.isLinux) {
|
||||
if (_path == null) {
|
||||
return DynamicLibrary.open('libsherpa-onnx-c-api.so');
|
||||
|
||||
Reference in New Issue
Block a user