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 {