mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-14 20:33:41 +00:00
fix: ffi instance be singleton
This commit is contained in:
1 parent
91dfd78b77
commit
4b4c03fd90
18 files changed
+844
-5336
No files matched your search
@@ -6,17 +6,15 @@ class LibgopeedChannel implements LibgopeedAbi {
|
||||
static const _channel = MethodChannel('gopeed.com/libgopeed');
|
||||
|
||||
@override
|
||||
Future<String> create(String cfg) async {
|
||||
final result = await _channel.invokeMethod<String>('create', {
|
||||
Future<void> init(String cfg) async {
|
||||
await _channel.invokeMethod<String>('init', {
|
||||
'cfg': cfg,
|
||||
});
|
||||
return result!;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<String> invoke(int instance, String params) async {
|
||||
Future<String> invoke(String params) async {
|
||||
final result = await _channel.invokeMethod<String>('invoke', {
|
||||
'instance': instance,
|
||||
'params': params,
|
||||
});
|
||||
return result!;
|
||||
|
||||
Reference in new issue
Block a user