MethodChannelFlutterAria2 class
基于 MethodChannel 的 FlutterAria2Platform 实现。
错误处理:原生层通过 PlatformException 返回错误时,统一包装为 Aria2Exception 抛出, 不再使用默认值静默吞错;仅当协议明确允许 null 的接口(如 getGlobalOption)才返回 null。
- Inheritance
-
- Object
- PlatformInterface
- FlutterAria2Platform
- MethodChannelFlutterAria2
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- methodChannel → MethodChannel
-
与原生平台通信的 MethodChannel。
final
-
onDownloadEvent
→ Stream<
Aria2DownloadEventData> -
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addMetalink(
String metalinkFile, {Map< String, String> ? options, int position = -1}) → Future<List< String> > -
override
-
addTorrent(
String torrentFile, {List< String> ? webseedUris, Map<String, String> ? options, int position = -1}) → Future<String> -
override
-
addUri(
List< String> uris, {Map<String, String> ? options, int position = -1}) → Future<String> -
override
-
changeGlobalOption(
Map< String, String> options) → Future<int> -
override
-
changeOption(
String gid, Map< String, String> options) → Future<int> -
override
-
changePosition(
String gid, int pos, Aria2OffsetMode how) → Future< int> -
override
-
getActiveDownload(
) → Future< List< String> > -
override
-
getDownloadBtMetaInfo(
String gid) → Future< Aria2BtMetaInfoData> -
override
-
getDownloadFiles(
String gid) → Future< List< Aria2FileData> > -
override
-
getDownloadInfo(
String gid) → Future< Aria2DownloadInfo> -
override
-
getDownloadOption(
String gid, String name) → Future< String?> -
override
-
getDownloadOptions(
String gid) → Future< Map< String, String> > -
override
-
getGlobalOption(
String name) → Future< String?> -
override
-
getGlobalOptions(
) → Future< Map< String, String> > -
override
-
getGlobalStat(
) → Future< Aria2GlobalStat> -
override
-
getPlatformVersion(
) → Future< String?> -
override
-
libraryDeinit(
) → Future< int> -
override
-
libraryInit(
) → Future< int> -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pauseDownload(
String gid, {bool force = false}) → Future< int> -
override
-
removeDownload(
String gid, {bool force = false}) → Future< int> -
override
-
run(
) → Future< int> -
override
-
sessionFinal(
) → Future< int> -
override
-
sessionNew(
{Map< String, String> ? options, bool keepRunning = true}) → Future<void> -
override
-
shutdown(
{bool force = false}) → Future< int> -
override
-
startNativeRunLoop(
) → Future< void> -
在原生后台线程启动持续事件循环 (ARIA2_RUN_DEFAULT)。
override
-
stopNativeRunLoop(
) → Future< void> -
停止原生后台事件循环。
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unpauseDownload(
String gid) → Future< int> -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited