mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 04:43:41 +00:00
feat: direct call download api by cgo dart
This commit is contained in:
1 parent
467ada5500
commit
91dfd78b77
71 files changed
+6936
-1883
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../libgopeed_interface.dart';
|
||||
|
||||
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', {
|
||||
'cfg': cfg,
|
||||
});
|
||||
return result!;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<String> invoke(int instance, String params) async {
|
||||
final result = await _channel.invokeMethod<String>('invoke', {
|
||||
'instance': instance,
|
||||
'params': params,
|
||||
});
|
||||
return result!;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user