You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
582 B

import 'dart:async';
import 'dart:io';
import 'package:flutter/services.dart';
class TestPlugin {
static const MethodChannel _channel = MethodChannel('test');
/// 获取OpenAI SDK版本信息
static Future<String> getVersion() async {
if (Platform.isIOS) {
try {
final String version = await _channel.invokeMethod('getVersion');
return version;
} on PlatformException catch (e) {
throw Exception('获取版本失败: ${e.message}');
}
} else {
throw UnsupportedError('此插件目前仅支持iOS平台');
}
}
}