Support the platform iOS for Flutter (#1079)

This commit is contained in:
Fangjun Kuang
2024-07-06 19:43:37 +08:00
committed by GitHub
parent a25075101c
commit 1fe12c5107
67 changed files with 2040 additions and 46 deletions

View File

@@ -19,11 +19,9 @@ String? _path;
// see also
// 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.isIOS) {
throw UnsupportedError('Unknown platform: ${Platform.operatingSystem}');
}
if (Platform.isMacOS) {
if (Platform.isMacOS || Platform.isIOS) {
if (_path == null) {
return DynamicLibrary.open('libsherpa-onnx-c-api.dylib');
} else {

View File

@@ -17,7 +17,7 @@ topics:
- voice-activity-detection
# remember to change the version in ../sherpa_onnx_macos/macos/sherpa_onnx_macos.podspec
version: 1.10.10
version: 1.10.11
homepage: https://github.com/k2-fsa/sherpa-onnx
@@ -30,24 +30,31 @@ dependencies:
flutter:
sdk: flutter
sherpa_onnx_android: ^1.10.10
sherpa_onnx_android: ^1.10.11
# path: ../sherpa_onnx_android
sherpa_onnx_macos: ^1.10.10
sherpa_onnx_macos: ^1.10.11
# path: ../sherpa_onnx_macos
sherpa_onnx_linux: ^1.10.10
sherpa_onnx_linux: ^1.10.11
# path: ../sherpa_onnx_linux
#
sherpa_onnx_windows: ^1.10.10
sherpa_onnx_windows: ^1.10.11
# path: ../sherpa_onnx_windows
sherpa_onnx_ios: ^1.10.11
# sherpa_onnx_ios:
# path: ../sherpa_onnx_ios
flutter:
plugin:
platforms:
android:
default_package: sherpa_onnx_android
ios:
default_package: sherpa_onnx_ios
macos:
default_package: sherpa_onnx_macos